Skip to content

Instantly share code, notes, and snippets.

#import <Foundation/Foundation.h>
@interface NSString(Extensions)
-(NSString *) sha1Hash;
@end
#!/bin/sh
# Send the file to our running Emacs and bring it to the foreground.
~/tools/emacs/bin/emacsclient "${1}" \
2> /dev/null \
# If that failed, then open a new emacs visiting the file.
if [ $? -ne 0 ]; then
dir=sed "/s/\/cygdrive\//g/" ${PWD} 2> /dev/null
EOPEN_DIR="${dir}" EOPEN_FILE="${1}" ~/tools/emacs/bin/runemacs.exe
#!/bin/sh
# Send the file to our running Emacs and bring it to the foreground.
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient "${1}" \
2> /dev/null \
&& open -a Emacs
# If that failed, then open a new emacs visiting the file.
if [ $? -ne 0 ]; then
EOPEN_DIR="${PWD}" EOPEN_FILE="${1}" open -a Emacs
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
function extract {
echo Extracting $1 ...
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
module Kernel
def min(*args)
[*args].inject {|a,b| a = a < b ? a : b}
end
end
module Kernel
def min(*args)
[*args].sort.first
end
end