[NOTE] gb with private github repositories

12 Jun 2016

Workaround for getting gb to play nice with vendored private repositories. Add following lines to .gitconfig file:

[url "git@github.com:mattias-lundell"]
  insteadOf = https://github.com/mattias-lundell

[NOTE] defer timing trick

06 Dec 2015

Example of how to use defer in golang as a crude way of measure execution time. Start by defining the timeit function. The function just prints the duration from the time given by start.

func timeit(start time.Time, text string) {
    log.Info("PERF [%s] [%s]", text, time.Since(start))

Using the defer keyword we can make timeit execute directly after the function that we want to measure. Passing time.Now() as argument gives us a timer that measures execution time for the function body.

func timedFunction() {
    defer timeit(time.Now())
    time.Sleep(500 * time.Millisecond)

Calling timedFunction() should print

PERF [timedFunction] [500ms]

[NOTE] defrecord

26 Aug 2015

Clojure defrecord does not expose the constructor outside the namespace

(defrecord Point [x y])
(def origin (Point. 0 0)) ; only avalable in namespace

Instead use the automatically generated constructor

(def origin (->Point 0 0)) ; available in other namespaces

[PODCAST] The Type Theory Podcast - Dan Licata on Homotopy Type Theory

14 Jan 2015


[LINK] Rust by Example

19 Dec 2014


[PODCAST] Haskell cast episode 9 - Conal Elliot

18 Dec 2014


Conal Elliot on functional reactive programming and denotational design.

[PODCAST] Functional Geekery - Eric Normand

24 Nov 2014


[VIDEO] Playing Go with Clojure

17 Nov 2014

Clojure/conj 2012 - Zach Tellman - Playing Go with Clojure.

[VIDEO] Verifying Stateful and Side-effecting Programs using Dependent Types

16 Nov 2014

CodeMesh 2014 - Edwin Brady - Verifying Stateful and Side-effecting Programs using Dependent Types

Hello World!

09 Nov 2014

Less is more.