This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSString(Extensions) | |
-(NSString *) sha1Hash; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kernel | |
def min(*args) | |
[*args].inject {|a,b| a = a < b ? a : b} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kernel | |
def min(*args) | |
[*args].sort.first | |
end | |
end |
NewerOlder