Skip to content

Instantly share code, notes, and snippets.

@dryman
dryman / gist:883076
Created March 23, 2011 13:20
git on prompt
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
export PS1="\[\033[1;32m\]\w\[\033[0m \[\033[0m\]\[\033[1;34m\]\$(git_branch)\[\033[0m\]$ "
sudo brew update
sudo brew install jruby # latest version is 1.6 (03/24/2010)
sudo gems update --system
sudo gems uninstall rawr # rawr should install via jruby
sudo jruby -S gems install rawr
# at root directory of CompassApp
sudo jruby -S rake rawr:bundle:app
# build location is package/osx/compass.app
sudo brew update
sudo brew install jruby # latest version is 1.6 (03/24/2010)
sudo gems update --system
sudo gems uninstall rawr # rawr should install via jruby
sudo jruby -S gems install rawr
# at root directory of CompassApp
sudo jruby -S rake rawr:bundle:app
# build location is package/osx/compass.app
# on server
if [ $TERM == "dumb" ] || [ $TERM == "vt102" ]; then
export TERM="xterm-color"
screen -RD
fi
# In irssi, /set term_charset big5
# Add client id_rsa.pub to your server .ssh/authorized_keys
# use ssh://yourId@yourserver from Nally to login ;)
@dryman
dryman / IMKTest.m
Created November 15, 2011 03:04
Unit test for IMK
#import <SenTestingKit/SenTestingKit.h>
#import "NumberInputController.h"
@interface IMKTest : SenTestCase {
IMKServer* server;
NumberInputController* controller;
}
@end
#import <Foundation/Foundation.h>
#import "DDFileReader.h"
#define MACRO_VALUE_TO_STRING_( m ) #m
#define MACRO_VALUE_TO_STRING( m ) MACRO_VALUE_TO_STRING_( m )
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
alias ls="ls -G"
source ~/perl5/perlbrew/etc/bashrc
export PATH="/usr/local/Cellar/siege/2.70/bin/:~/bin:/Applications/MATLAB_R2011a.app/bin:$PATH"
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
function git_since_last_commit {
(defstruct rb
(l nil) (r nil) data (red T))
(defparameter *tree* nil)
(defun rb-kid (root dirs)
"Get children of node via (rb-kid node '(nil nil T nil))
where nil means left and T means the right branch of a node."
(if (endp dirs) root
(if (car dirs)
(rb-kid (rb-r root) (cdr dirs))
@dryman
dryman / gist:2650855
Created May 10, 2012 03:27
Power Set
(defn power-set [lst]
(if (seq lst)
(clojure.set/union
(apply hash-set (for [x (next lst)] #{(first lst) x}))
(power-set (next lst)))
#{#{}}))
alias ls="ls -G"
source ~/perl5/perlbrew/etc/bashrc
export PATH="/usr/local/Cellar/siege/2.70/bin/:~/bin:/Applications/MATLAB_R2011a.app/bin:$PATH"
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
function git_since_last_commit {