Skip to content

Instantly share code, notes, and snippets.


Helpers that are meant to be copied, pasted and modified... not imported.


The secretbox library is intended to minimize the number of ways to screw things up, but using it still requires some setup.

func Seal(data, key []byte) []byte {
	if len(key) != 32 {
		panic("invalid key length")

Keybase proof

I hereby claim:

  • I am kalafut on github.
  • I am kalafut ( on keybase.
  • I have a public key ASBFWROk5GskUBI7MP7ZaeBX6noxn15vMoXxZOK3jJ43wQo

To claim this, I am signing this object:

kalafut / logical_system.go
Created Mar 30, 2018
Example that really slows vim-go's package comment folding
View logical_system.go
package vault
import (
kalafut / django_init
Last active Oct 19, 2021
Simple creation of a single-app django project
View django_init
# Simple creation of a single-app django project, as described in:
# ./django_init foo
# This will result is the following flat structure:
# .
# └── foo
kalafut / example.go
Created Oct 11, 2015
Sample file that will generate gorename errors
View example.go
package main
// Running gorename -from example.go::Foo -to foo on this file will not work.
// There are multiple errors, but it appears that gorename stops after the first one.
// example.go:16:6: renaming this type "Foo" to "foo"
// example.go:21:6: conflicts with func in same block
// After commenting out or changing foo(), the errors moves down:
kalafut /
Created Jun 19, 2014
Retrieve bookmarks from Pindroid
import json
import sqlite3
output = []
conn = sqlite3.connect('PinboardBookmarks.db')
c = conn.cursor()
for row in c.execute("SELECT url, description, tags FROM bookmark"):
output.append({"href": row[0], "description": row[1], "tags": row[2]})