Archive

Coding Bits

I learned about Insomnia from Vinay.

Insomnia makes sending REST requests really easy to manage, so you don’t have to store a whole bunch of curl commands.

It’s very similar to Postman (also an excellent requests manager).

Harry would probably tell me there’s an emacs mode for this.

I bet that emacs mode doesn’t have a punny name.

I learned about Hugo the other day. It’s a Go based static site generator much like Jekyll.

I’m not convinced it’s significantly better than Jekyll. Compilation speed is a negligible feature for me.

It seems like it’s the new hotness (much like how Netlify is the sexier Heroku).

I feel olde.

 

This is to help my future self.

Sometimes startx won’t load after updating Debian. I’ll often get no error messages in the logs, or the unhelpful message failed to set IOPL for I/O (which is a red herring). There are many reasons why startx might fail, so this issue is particularly difficult to search for.

I usually ask Harry for help.

Here’s what we did this time:

  1. Boot into recovery mode
  2. sudo tasksel
  3. reinstall Gnome

Maybe this will help me next time.

Harry and I went to Boulder Python and heard Brandon Rhodes talk about design patterns. It’s always so delightful to hear one of his talks.

This talk was about putting together a patterns guide (Gang of Four style) that are useful in Python).

https://python-patterns.guide/

Harry was reminded of Russ Olsen’s Design Patterns in Ruby.

I should give them both a read and see how much of the patterns is Python-specific vs general dynamic languages.

If you’re using Activerecord Enums, it’s common to store the values that represent the enums as integers in the database. If you wanted more guarantees from the database, you’d store the values as SQL enums. However, Rail’s schema dump doesn’t SQL enums very well.

Here are some tradeoffs:

Integers SQL enums
Database Guarantees No Yes
schema.rb Supported Not supported (need to use structure.sql)

Here’s a good tutorial on how to use Activerecord Enums for either case.