Skip to content

Instantly share code, notes, and snippets.

@egonelbre
egonelbre / gist:1311842
Created October 25, 2011 08:28
Design Patterns in GO
///////
// Warning, code untested
///////
type Thinger interface {
SomeMethod( arg bool ) bool
}
type RealThing struct {
state bool
@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate
@msantos
msantos / mem.c
Created January 2, 2011 20:41
malloc/free example NIF
/* gcc -fPIC -shared -o mem.so mem.c -I /usr/local/lib/erlang/usr/include */
#include <stdio.h>
#include <string.h>
#include "erl_nif.h"
static ERL_NIF_TERM atom_ok;
static ERL_NIF_TERM atom_error;