Tag: code

Iced to Electron

I got really frustrated by GitKraken. I’ve been using it for years now both for work and for hobby projects without much to complain about really. Then again I’m not a heavy git user: mostly I just commit and push, only occasionally squashing or cherry picking. I don’t even remember when was the last time I needed a rebase, but it wasn’t yesterday.

However recently GitKraken started having these weird problems with my work repositories. These can get pretty big (by my standards) with tons of branches getting pushed to in parallel (and in the early days some very large blobs got checked in too). Because the branches move really quick it’s important that I can keep my own up to date by merging the head branch back.


GitOps and Kubernetes persistence

A while back I wrote about bootstrapping a Kubernetes cluster. I’ve been refining the setup so that it requires as little manual kubectl‘ing as possible. I still use ArgoCD to get everything rolling, and there is one bit that kept going red: persistent volumes.


可変個! 可変個! そして手動gensym!

Clojureを紹介する記事はよくマクロの存在を最強の武器としてあげているが、実際にマクロはそう頻繁には使わない気がする。個人的にマクロを作る目印になるのはとあるウィキの記事に書いてある基準。

C++を主にみたデザインパターンの考え方の批判で指摘されるのは、ああやってパターンを繰り返し適応するのはまだコード化できてないなんらかの抽象化があることを示している。

コードに規則性や繰り返しが現れるのは、今使っている抽象化が十分ではない印。例えばマクロに任せるべきコード展開を手動でやっている。

Paul Graham: Revenge of the nerds

Hacktoberfest

After last year, I once again decided to take part in the Hacktoberfest fun. I have plenty of repositories lying around (sadly much less well maintained by yours truly than preferable). Of course this also means that I can gather the necessary contributions from updating dependencies in my own repositories, but I’d prefer to instead contribute to those dependencies.


k3s

Having played around with the managed Kubernetes offerings of various cloud players (DO, AWS, GCP), I was wondering if it was possible to do this cheap. My site doesn’t have much traffic or anything complicated really, so running it off a $5 DO droplet is reasonable. Sadly managed Kubernetes offerings won’t come out so cheap. (Sure I could leech off the starting $300 GCP credit for a year then keep hopping accounts, but…)

Then I read about k3s. The people behind Rancher made it as a lightweight (but functionally complete) Kubernetes distro. Lightweight, they say… Just how light? (Imagine a weird maniac light in my eyes here.) Could I run it on a $5 droplet?


Garden

I think many people of my profession got recommended a certain article by Medium in their weekly digest. The launch-introduction post by Garden got my attention too. I’ve been trying to figure out how to deal with developing on Kubernetes, so every drop of information in that regard is much welcome.


Mapping

The other day I was thinking about Rich Hickey’s keynote at last year’s Conj. He goes into how the literal maps (or hashes or hashmaps or however a language prefers to call them) are really functions too. A function in maths is a mapping between sets and that’s what maps are.

Then that makes functions we normally write are just like that too, except the mappings are more abstract and defined through code. Because the mappings are so complex and indirect, we write tests to check (automated) that the mapping we defined through code is correct.

Obviously defining the exact mappings for every possible combination of the input set(s) is not feasible (that’d be a map, the end). But if “all” is not possible then how much is? What exactly is the absolute minimum amount of test( case)s that’s useful?


SNS連合とActivityPubで通信できた

タイトル通りではあるが、その言葉全部通じない人も少なからずいるし、そもそもどうやっては書いてない。まずは言葉の定義から順にする:ActivityPubって何、それを使った通信が一体どんなものか、SNS連合とは何なのか、そして最後どうやってそれと通信できたかを述べる。


手軽に可視化したい

ここしばらくは空いてる時間でキツネという分散型SNSを開発している。分散型SNSは一台のサーバーで完結せず、ActivityPubやOStatusといったプロトコルでいろんなサービス(Mastodon, Pleromaなど)とのサーバー間の通信も重要。

本番に上がって使ってもらう時はもちろん、現状の開発中でもログは不可欠。バグがもしあった時に、いちいちデバグ文をあちこちに入れて何とか原因を突き詰める作業をできるだけ減らしたい。俺に考えつくのは、例えばリクエストや処理が失敗したとしても、初段の調査に最低限必要な情報は既にログにあるようにしたい。


No JavaScript, please

The other day I got an email from Axosoft that the payment for my GitKraken license (yes I use GitKraken) was rejected by my credit card company. It was because the card I used there expired, but nonetheless I had to take action.

That involved going on their website and changing my payment method to a card that still worked. It involved first an overwhelmingly complex table like this.