Skip to content

Instantly share code, notes, and snippets.

@cooldaemon
cooldaemon / Makefile
Created May 5, 2009 06:51
libxml2 sax sample.
xml2_sax_sample: xml2_sax_sample.c
gcc -o xml2_sax_sample `xml2-config --cflags --libs` xml2_sax_sample.c
clean:
rm xml2_sax_sample
(use '(incanter core processing))
;; simple interactive Processing example taken from processingjs.org website:
;; http://processingjs.org/source/basic-example/processingjs_basic-example.html
;; set up variable references to use in the sketch object
(let [radius (ref 50.0)
X (ref nil)
Y (ref nil)
@takumikinjo
takumikinjo / .gitignore
Created August 5, 2010 13:56
HTML5 Presentation export for Org-mode
README.html
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active November 2, 2024 12:56
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@hannestyden
hannestyden / post-checkout
Created October 28, 2010 11:26
Prints a random line from the bridge of Metallica's "Master of Puppets" when checking out the master branch.
#!/bin/sh
# .git/hooks/post-checkout
# chmod +x .git/hooks/post-checkout
if [ $(git symbolic-ref HEAD | cut -d '/' -f 3) == 'master' ]; then
lines[0]="Master, Master, where's the dreams that I've been after?"
lines[1]="Master, Master, you promised only lies"
lines[2]="Laughter, laughter, all I hear or see is laughter"
lines[3]="Laughter, laughter, laughing at my cries"
echo " ${lines[$((RANDOM%${#lines[*]}))]}";
@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@johnjohndoe
johnjohndoe / gist:723302
Created December 1, 2010 10:27
Colored bash prompt showing git branch (.bash_rc)
# Set git tab completion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
GIT_PS1_SHOWDIRTYSTATE=true
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
@mechanicker
mechanicker / emacsserver.el
Created December 2, 2010 10:01
Emacs client implementation in lisp
;; -*-mode:Emacs-Lisp;buffer-cleanup-p:t-*-
;; Time-stamp: <2010-09-15 08:54:34 dky>
;;-----------------------------------------------------------------------------
;; File : emacsserver.el
;; Auth : Dhruva Krishnamurthy ([email protected])
;; Status : Development (flaky)
;; Usage :
;; o As server:
;; (require 'emacsserver)
;; (emacsserver-start "magic")
@johnjohndoe
johnjohndoe / .gitignore
Created January 3, 2011 18:04
A git log alias with colors, date and owner.
# A git log alias.
# Shows the brief log describtion in one line.
# Adds colors, a relative date and the owner.
# File name: .gitconfig
[alias]
look = log --graph --pretty=format:'%Cred %h : %Creset%s %Cgreen(%cr) %C(blue)<%an>%C(yellow)%d %Creset' --date=relative
@tjhanley
tjhanley / xcodeversionr.sh
Created February 23, 2011 21:55
command line utility to write the version number and the git commit hash to your projects Bundle Version Id
#!/usr/bin/env bash
# place this in your path somewhere
# usage xcodeversionr.sh 1.0.1 MyProject-Info.plist
echo "Version: $1"
echo "File: $2"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $1 (build `git rev-parse --short HEAD`)" $2