Skip to content

Instantly share code, notes, and snippets.

View tudborg's full-sized avatar
💻
Teaching sand to think was a mistake.

Henrik Tudborg tudborg

💻
Teaching sand to think was a mistake.
View GitHub Profile
@tudborg
tudborg / rebar3.sublime-build
Last active July 8, 2017 10:02
rebar3 sublime text 3 build system
{
"cmd": ["rebar3", "compile"],
"env": { "REBAR_COLOR": "none" },
"working_dir": "${project_path:${folder}}",
"file_regex": "^([^: ]+):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.erlang",
"variants": [
{
"name": "Clean",
"cmd": ["rebar3", "clean"]

Keybase proof

I hereby claim:

  • I am tbug on github.
  • I am tudborg (https://keybase.io/tudborg) on keybase.
  • I have a public key whose fingerprint is 7C7E E255 67D3 BD78 38C8 2CF1 587F 9735 92F4 769A

To claim this, I am signing this object:

def f(d={}): # <-- danger zone
d["i"] = d.get("i", 0)+1
return d["i"]
@tudborg
tudborg / gist:a191f4d805c1117938e6
Last active August 29, 2015 14:02
PHP Lint git commit hook
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
git diff --cached --name-only $against | grep -e \.php$ | while read FILE; do
@tudborg
tudborg / prompt.sh
Last active January 4, 2016 18:08
Simple PS1 and PS2 for bash
#a wrapper function to keep colors from polluting global space
function _set_prompt () {
local R="\[\033[0m\]" #reset
local B="\[\033[1m\]" #bold
local D="\[\033[2m\]" #dim
local U="\[\033[4m\]" #underline
#took the colors _i_ think are nice and defined as vars
local DEFAULT="\[\033[39m\]"
local RED="\[\033[91m\]"
local GREEN="\[\033[32m\]"
@tudborg
tudborg / vpython
Last active July 23, 2017 23:24
vpython - a virtualenv helper for calling python inside any virtualenv without activating it
#! /bin/bash
# Run python stuff inside your virtualenv without activating it
# vpython is like calling python inside a virtualenv, except you
# don't have to worry about calling activate.
# Very useful for cli applications that you just link to somewhere in your path
# but still want to install deps inside a virtualenv.
#
# Maintained by https://github.com/tbug @ https://gist.github.com/tbug/8640347
# Usage:
function GameState () {
var state = [];
//Init game state here
var clickField = function (x,y) {
//change the game state here acording to click in x,y
};
Object.defineProperty(this, 'complete', {
get: function () {
@tudborg
tudborg / tintdemo_v1.txt
Created December 15, 2011 21:55
tint - first demo
===================================
INPUT
===================================
\begin section |websocket data pipeline|
When a WebSocket is created, functions to handle deifferent events may also
be defined. The possible events are:
\begin list
* opopen