Skip to content

Instantly share code, notes, and snippets.

View seanh's full-sized avatar

Sean Hammond seanh

View GitHub Profile
@seanh
seanh / gist:784970
Created January 18, 2011 19:28
Sharing a git repository locally
seanh creates a shared, bare repository which members of the 'clickeast'
group can read but not write, and pushes some commits into it:
seanh@kisimul:~ % cd /
seanh@kisimul:/ % sudo mkdir ClickEast.git
seanh@kisimul:/ % sudo chown seanh ClickEast.git
seanh@kisimul:/ % chgrp clickeast ClickEast.git
seanh@kisimul:/ % chmod g+rx ClickEast.git
seanh@kisimul:/ % chmod g+s ClickEast.git
seanh@kisimul:/ % cd ClickEast.git
#import "cocos2d.h"
#import "Sprite.h"
@interface TargetSprite : Sprite <CCTargetedTouchDelegate> {
}
/*!
* Initialise a TargetSprite using the given dictionary.
*
//
// Sprite.m
// MyGame
//
// Created by Sean Hammond on 02/12/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "Sprite.h"
#import "Config.h"
@seanh
seanh / gist:810581
Created February 4, 2011 01:26
Python: create a directory if it doesn't already exist.
if not os.path.isdir('somedir/'):
os.mkdir('somedir/')
+(id) node
{
return [[[self alloc] init] autorelease];
}
#0 0x0162b0b0 in objc_msgSend ()
#1 0x06828c50 in ?? ()
#2 0x0043e866 in NSKeyValuePushPendingNotificationPerThread ()
#3 0x0043e1b5 in NSKeyValueWillChange ()
#4 0x00425249 in -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] ()
#5 0x00447840 in _NSSetObjectValueAndNotify ()
#6 0x00015d35 in -[CharacterSettings doToggle:] (self=0x5599200, _cmd=0xa3c92, menuItem=0x559de90) at /Users/seanh/Documents/MyGame/CharacterSettings.m:54
#7 0x01435c7d in __invoking___ ()
#8 0x01435b51 in -[NSInvocation invoke] ()
#9 0x00048d2d in -[CCMenuItem activate] (self=0x559de90, _cmd=0xab0ea) at /Users/seanh/Documents/MyGame/libs/cocos2d/CCMenuItem.m:133
-(id) initWithTarget:(id)target selector:(SEL)selector
unlockedItem:(CCMenuItem *)unlockedItem
lockedItem:(CCMenuItem *)lockedItem
{
if ((self=[super initWithTarget:target selector:selector items:unlockedItem,lockedItem,nil]))
{
passcodeScene = [[PasscodeScene alloc] initWithTarget:self
selector:@selector(doToggle)];
}
return self;
seanh@sooty:...branchable.com % make
Utility.hs:57:7:
Could not find module `System.Log.Logger':
Use -v to see a list of the files searched for.
** building without S3 support
ghc -O2 -Wall -ignore-package monads-fd -fspec-constr-count=5 --make git-annex
Utility.hs:57:7:
Could not find module `System.Log.Logger':
seanh@sooty:...chable.com % (1) sudo cabal build
Preprocessing executables for git-annex-3.20110703...
Building git-annex-3.20110703...
[ 1 of 91] Compiling Base64 ( Base64.hs, dist/build/git-annex/git-annex-tmp/Base64.o )
[ 2 of 91] Compiling Touch ( Touch.hs, dist/build/git-annex/git-annex-tmp/Touch.o )
[ 3 of 91] Compiling Dot ( Dot.hs, dist/build/git-annex/git-annex-tmp/Dot.o )
[ 4 of 91] Compiling StatFS ( StatFS.hs, dist/build/git-annex/git-annex-tmp/StatFS.o )
[ 5 of 91] Compiling DataUnits ( DataUnits.hs, dist/build/git-annex/git-annex-tmp/DataUnits.o )
[ 6 of 91] Compiling SysConfig ( SysConfig.hs, dist/build/git-annex/git-annex-tmp/SysConfig.o )
[ 7 of 91] Compiling Types.Crypto ( Types/Crypto.hs, dist/build/git-annex/git-annex-tmp/Types/Crypto.o )
// Class objects are loaded into a dictionary.
factories = [NSMutableDictionary new];
[factories setObject:[SomeClass class] forKey:@"some string"];
.
.
.
// Later, a class from the dictionary is used to init a new object.
Class someClass = [factories objectForKey:someString];