Skip to content

Instantly share code, notes, and snippets.

View qrw's full-sized avatar
😀
i am happy

Rongwei Qian qrw

😀
i am happy
View GitHub Profile
#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;
using namespace CocosDenshion;
CCScene* HelloWorld::scene()
{
CCScene *scene = CCScene::create();
HelloWorld *layer = HelloWorld::create();
#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;
using namespace CocosDenshion;
CCScene* HelloWorld::scene()
{
CCScene *scene = CCScene::create();
HelloWorld *layer = HelloWorld::create();
@qrw
qrw / gist:2941874
Created June 16, 2012 16:32
history top 10
history |awk '{C[$2]++;count++;} END {for(a in C) print C[a]" " C[a]/count*100 "% " a}' |grep -v "./" |column -c3 -s " " -t|sort -nr |nl|head -n 10
@qrw
qrw / gist:2896069
Created June 8, 2012 15:06
brew install redis
if you got following error when "brew install redis"
Error: Failed executing: make -C src
try this:
$brew install redis --use-llvm
@qrw
qrw / gist:2377455
Created April 13, 2012 14:58
Define a class with a singleton instance
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance
@singleton
class MyClass:
@qrw
qrw / git commit
Created April 13, 2012 14:54
git:commit all modified files in one line
git add $(git ls-files -m)