Evan Moses

My blog and projects

  • No I don't want 2, Emacs

    This blog, and the vast majority of the code I write, is written in Emacs with evil (a vim emulation mode). I have a nasty habit of mashing :w2<ret> when I really was trying to save the current buffer with :w<ret> . :w2 writes the current buffer to a new file called 2, which I don’t believe I have ever done on purpose. So, I added this little gem to my .

    Read more…
  • Representing State as interfaces in Go

    I made up a neat little pattern in Go the other day. It’s a way to represent a state change in a system by exposing different APIs for different states, while only holding state in a single underlying struct. I’m sure I’m not the first person to invent this, and it may already a name, so please let me know if you know of one [Update: apg on Lobsters pointed out the name “typestate”, which I like].

    Read more…
  • Building a custom Emacs auth-source

    My employer, Okta, has recently been making security improvements to how we access all sorts of internal systems. As part of that hardening, we’ve been disallowed from using SSH keys and long-lived GitHub tokens to access our code on GitHub. In place of that, we’ve now got an internal tool that grants us short-lived tokens on demand, after SSOing (through Okta of course). This is a good idea even if it adds a little friction, and means that if you gain access to my machine somehow you won’t automatically have my privileges to access our code base.

    Read more…