Daniel Keast

Stuff about Programming

My current tmux config

My configuration file for tmux has changed a lot over the years. I ended up with all sorts of custom settings after reading tmux by Brian P. Hogan, and the Arch Wiki page. Both are great resources, but I ended up with a config file that I didn’t fully understand or use. I’ve since trimmed it down to only the parts I use regularly. This should also make upgrades easier, since tmux has a habit of breaking config file compatibility between versions.

Makefile for Markdown

I have a little git repository for keeping recipes. They’re all Markdown files, and I use pandoc to convert them into pdfs. I’ve created a Makefile for doing the conversion:

Game loop frame timer

I love video games, and partly started programming in the first place to learn how they work. Recently I’ve been learning OpenGL in an effort to try and build a simple game engine.

Real World Haskell 4

These are the first exercises of chapter 4.

Real World Haskell 3

Finally got it I think. This was bloody tricky.

Real World Haskell 2

There are several more questions in this book at the end of the chapter.

Real World Haskell

Real World Haskell chapter 3 is about recursive data types, and includes an example of creating a list-like data structure.

Short circuiting is lazy

I’m used to the concept of short circuiting operators. For example, in this Python code “evaluated” is never printed as it is clear before then that the entire if branch must resolve to True.

Python array columns

I wanted to access the columns in a 2D array in Python today. I found that it’s surprisingly simple to do. This is what I ended up with:

Rust's ownership system

Rust is a systems programming language. It aims for there to be as little as possible between your code and the hardware running it. The reason for this is to give you full control of what the CPU is doing, and how your data structures are laid out in memory.

SQLite in Python

Python contains a SQLite client in it’s standard library. This is really useful for prototyping, and great for when a script grows into needing a little more data integrity. It’s really quite unexpected to be able to use something like this without any dependencies.

Jinja template as json

I found myself creating a mock web service for use in tests today. The idea was that during test setup I could post some json data that would then be returned during the test itself. Only a few parts of the response would change between tests, so I wanted to specify as little as possible to keep the tests descriptive.

Sum types and Rust

I’ve been listening to the Lambdacast podcast recently. During one episode they had a discussion about algebraic data types and the differences between product and sum types. I’d heard the term algebraic data types before, but had no idea what product or sum types are.

Jekyll

I have no need for dynamic content, and so much prefer the simplicity of having a static website. With a static site generator you can get some of the benefits of dynamic apps (automatically updated menus, avoiding duplication in markup) with much higher security and lower maintenance.

Python DocTest

Python has a module called doctest in it’s standard library that will search for usage examples in your documentation and check that they work as shown. This means you can copy and paste snippets from the interactive shell, and ensure that they’re kept up to date.