Party Tricks: Empty List Expansion

Nov 15, 2018
Let’s say we’ve got a bunch of functions accessed through a dictionary, like this: def f0(): return 0 def f1(a0): return 0 def f2(a0, a1): return 0 funcs = { 'f0': f0, 'f1': f1, 'f2': f2 } We call these functions like this: funcs['f0']() Now assume we want to call these functions with user-provided arguments. Say, for example, that the user wants to call f1 with argument a. They pass the string 'f1 a'. (read more)

Writing a JSON Generator

Oct 19, 2018
I started working on a service to generate mock json data. A few of these services already exist, but it seemed like it would be a fun thing to write anyway. The idea is that you POST some model json and a positive integer n to the endpoint and you get back n copies of your object with the fields filled out. For example, the following model { "name" : {"first" : "firstName", "last" : "lastName"}, "age" : "personAge", "email" : "eMail" } might yield { "name" : {"first" : "Sarah", "last" : "MacDonald"}, "age" : "27", "email" : "smacd@gmail. (read more)

The Personal Server: Urbit and Sandstorm

Oct 9, 2018
Playing around with Urbit and Sandstorm for the past week has been fun. My findings so far: Sandstorm is by far the more immediately useful of the two. The apps are good if a bit neglected, and the whole thing is very approachable. Deploying a Hugo site on Sandstorm via the sandcats dns service took about 30 seconds. Pretty cool. If there was an easy bridge between a Sandstorm instance and Android, I think I’d have an ideal personal server. (read more)