Skip to content

Instantly share code, notes, and snippets.

@nddrylliog
nddrylliog / prepare-commit-msg
Created February 8, 2012 11:23 — forked from alexisbernard/prepare-commit-msg
Git hook to append Pivotal's story tag (prefix variant)
#!/bin/sh
# File: .git/hooks/prepare-commit-msg
# Append the Pivotal's story tag at the end of the commit message.
# Your branch must be named like this: 12345_my_branch.
story=$(git symbolic-ref HEAD|sed -r 's/^.*\/([0-9]+)_.*$/\1/') # -E instead of -r for Mac OS X
test $story && echo "[Story#$story]" >> $1
exit 0
@nddrylliog
nddrylliog / dotvar.ooc
Created September 5, 2011 14:45 — forked from ycros/dotvar.ooc
A: class <T> {
foo: T
init: func(=foo) {
"A init" printfln(foo as Int)
}
}
B: class extends A<Int> {
@nddrylliog
nddrylliog / dotvar.ooc
Created September 5, 2011 11:41 — forked from ycros/dotvar.ooc
A: class <T> {
}
B: class extends A<Int> {
a: T
}
@nddrylliog
nddrylliog / hacking-club-mate-imatate.md
Created August 4, 2011 14:08 — forked from Overbryd/hacking-club-mate-imatate.md
Hacking Club Mate "imatate"

Hacking Club Mate "imatate"

Read about the end result here

Join me when I start brewing my first batch of Club Mate. Inspired by a podcast from chaos radio express on the topic "Hackerbrausen" (Hacker's soda, listen here) I want to try this by myself.

So far I have bought all the necessary ingredients and tools to get started. And with the help from Jan (@janl) I can even carbonate the end result :)

When? Where?

TextCont: class {
value: String
}
Test: class {
_store: TextCont
something: func { something(_store&) }
# Makefile generated by rock, the ooc compiler written in ooc
CC=gcc
# try to determine the OS and architecture
OS := $(shell uname -s)
MACHINE := $(shell uname -m)
ifeq ($(OS), Linux)
ARCH=linux
else ifeq ($(OS), Darwin)
ARCH=osx
bar: unmangled func (t: C) {
"Hey, it's a %s" format(t class name) println()
}
C: class {
foo: extern(bar) func
}
C new() foo()
getSize: func <K> (list: ArrayList<K>) -> SizeT {
list size()
}
The bird is eating worms
The animal is eating stuff
Vector3f: class {
x, y, z : Float
}
vec := Vector3f new()
vec x = 3.14
vec y = 6.18
vec z = 42.0 // hey, Java/C/C++/C# guys: look! no dots =)