Kasper Tidemann - human, developer, businessman, man of the world.
From our hands we give.

Category: Terminal

How not to rm yourself

Sindre Sorhus has written a small, concise piece on how not to rm yourself when scripting things. It’s a well-recommended read, especially if you’re open sourcing your code.

Parsing Office Open XML documents

With the release of the Office 2007 suite, Microsoft finally started using an open format for Word documents named Office Open XML (sometimes referred to as OOXML). Basically, a .docx file is just a ZIP file in disguise with the following basic contents: [Content_Types].xml /_rels   .rels /docProps   app.xml   core.xml /word   document.xml   fontTable.xml   settings.xml   styles.xml   webSettings.xml […]

Pretty-printing JSON in the terminal

If you’re reading this, chances are you’ve probably worked with JSON in the terminal before. A very common use-case is when dealing with NoSQL databases such as MongoDB or Riak. curl‘ing the database for a resource spits out JSON like so: curl -X GET http://localhost:8098/riak/users?keys=true {“props”:{“name”:”users”,”allow_mult”:false,”basic_quorum”:false,”big_vclock”:50,”chash_keyfun”:{“mod”:”riak_core_util”,”fun”:”chash_std_keyfun”},”dw”:”quorum”,”last_write_wins”:false,”linkfun”:{“mod”:”riak_kv_wm_link_walker”,”fun”:”mapreduce_linkfun”},”n_val”:3,”notfound_ok”:true,”old_vclock”:86400,”postcommit”:[],”pr”:0,”precommit”:[],”pw”:0,”r”:”quorum”,”rw”:”quorum”,”small_vclock”:50,”w”:”quorum”,”young_vclock”:20},”keys”:[“kt@meemo.io”,”cl@meemo.io”]} Unfortunately, that’s not too easily readable. This brings us […]

Kasper Tidemann