Consultancy - Research Lab - Incubator

based in beautiful Zürich, Switzerland

- 362 words - 2 min read
#tricks

Back in the days when I was developing in Ruby most of my waking hours rbenv was a real life saver. But looking at what it does, it initially felt awkward how it "wrapped" the cd command. You could argue that the Ruby community are no strangers to guerrilla patching. But it felt less awkward when I learned that in my zsh it uses hooks instead of guerrilla patching to achieve the same goal: React on changing the directory.

In the meantime I tried a couple of things with zsh hooks to optimize work flows and what not, but...

- 325 words - 2 min read
#tooling

TL;DR Use codegraph to visualize dependencies within a Clojure file. Codegraph applied to itself will for example generate this graph:

example codegraph graph

Here is how it works.

The other day I wished I had a visualization of the dependencies in a piece of ClojureScript code that over the course of the year has gotten a bit unwieldy. I did some thinking and some codeing and it turns out it's quite easy. Here are some of the highlights in code & images, but mostly code.

Reading a string and have it evaluates in Clojure is done with read-string. Reading a...

- 436 words - 3 min read
#tooling

Frustration with slow and manual processes is probably my number one motivator to discover new tooling. Having lately worked with Swagger on a Json API I found myself in need of a tool to work with Json on the command line.

I tried a couple and just when I was about to make the decision that I want to try them all to find the best one my search was cut short when I tried jq. On the web site it claims: jq is like sed for JSON data. And come to think of it what would we do without...

- 176 words - 1 min read
#riotjs

Module Hot Loading enables a super efficient workflow without the pain of manual reloading of your web application. What do I mean by that? Well, the usual web developer cycle is:

  1. Write code
  2. Save code
  3. Switch to Browser
  4. Hit Reload
  5. See what happens
  6. Switch back to Editor

Half those steps (3, 4 and 6) are manual and very repetitive if you want to have an incremental development experience. They can be automated completely.

There are some frameworks that support Module hot-loading by now. ClojureScript and Elm probably were the first languages to support that paradigm, but...

- 102 words - 1 min read
#tricks

I'm using the command line extensively, with plenty of black terminals side by side in my tiling window manager I was looking for something that helps distinguish remote shells (via ssh) from my local shells.

Introducing one of my favorite tricks: Changing the background color of the terminal while running an ssh session.

function ssh() {
  dbus-send --session /net/sf/roxterm/Options net.sf.roxterm.Options.SetColourScheme string:$ROXTERM_ID string:Tango
  /usr/bin/ssh $@
  dbus-send --session /net/sf/roxterm/Options net.sf.roxterm.Options.SetColourScheme string:$ROXTERM_ID string:Default
}

In my setup I'm using zsh and roxterm, but I'm sure it'll work for other tools as well if you adjust it to yours.

- 367 words - 2 min read
#riotjs

If you want to use RiotJS Custom Tags within a <table>, you might have stumbled upon something that looks like a bug. If you nest Custom Tags within a <table> element, they will not render within said element, but outside of it. Let me clarify with an example and how to fix it.

If you have code that nests elements like this:

<todoList>
    <table>
      <tbody>
        <todo each="{ allTodos() }">
        </todo>
    </table>
</todoList>

Where <todo> is defined as...

- 240 words - 2 min read
#org-mode

Update: This is a re-post of an older blog post of mine. Originally it was posted on my personal blog. I'm deprecating my personal blog in favor of this 200OK blog.

You can use templates for different types of capture items, and for different target locations.

The following code sets up three capture templates – for todos, media urls and code snippets (lines 4-7).

%? sets the exit point for the template, %^g prompts for a tag, %^{language} prompts for the language of the snippet and the remainder is boilerplate to create an org-mode entry (*) and an...

- 677 words - 4 min read
#python

Update: This is a re-post of an older blog post of mine. Originally it was posted on my personal blog where it has >30 comments and >20'000 views over the last years. I'm deprecating my personal blog in favor of this 200OK blog.

Spoiler: This post is primarily gonna be an excerpt of my bookmarks collection. That’s because more intelligent men than me have already written great articles on the topic of how to become a great Python programmer.

I will focus on four primary topics: Functional programming, performance, testing and code guidelines. When those four aspects merge in one programmer,...

- 1124 words - 6 min read
#vim

Update: This is a re-post of an older blog post of mine. Originally it was posted on my personal blog where it has >130 comments and ~ 250'000 views over the last years. I'm deprecating my personal blog in favor of this 200OK blog.

Finding the perfect IDE for Python isn’t an easy feat. There are a great many to chose from, but even though some of them offer really nifty features, I can’t help myself but feel attracted to VIM anyway. I feel that no IDE accomplishes the task of giving the comfort of complete power over the code...

- 1406 words - 8 min read
#python

Update: This is a re-post of an older blog post of mine. Originally it was posted on my personal blog where it has ~40 comments and >35'000 views over the last years. I'm deprecating my personal blog in favor of this 200OK blog.

In this short tutorial, I’m going to show you how to scrape a website with the 3rd party html-parsing module BeautifulSoup in a practical example. We will search the wonderful translation engine dict.cc , which holds the key to over 700k translations from English to German and vice versa. Note that BeautifulSoup...