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
Horror Code Session. |
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 Footnoted | |
def self.included(base) | |
base.extend(ClassMethods) | |
has_footnote | |
end | |
module ClassMethods | |
def has_footnote |
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
require 'yaml' | |
# write yaml to a file | |
open('filename', 'w') {|f| f << something.to_yaml} | |
# read yaml from a file | |
something = YAML.load(open('filename')) |
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> | |
#import "SQLitePersistentObject.h" | |
@interface PersistablePerson : SQLitePersistentObject { | |
NSString *lastName; | |
} | |
@property (nonatomic, retain) NSString * lastName; | |
@end | |
PersistablePerson *person = [[PersistablePerson alloc] init]; |
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 javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
public static String someHashMethod(String data, String hash) { | |
byte[] hashBytes = hash.getBytes(); | |
SecretKeySpec signKey = new SecretKeySpec(hashBytes, "HmacSHA1"); | |
Mac mac = Mac.getInstance("HmacSHA1"); | |
mac.init(signKey); | |
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
syn match rspecDescribe "^\W*describe\W" | |
syn match rspecIt "^\W*it\W" | |
hi def link rspecDescribe Define | |
hi def link rspecIt Define |
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 parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "☠" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1) $(parse_git_dirty)/" | |
} | |
export PS1='\[\033[1;33m\]\w\[\033[0m\] $(parse_git_branch)\n→ ' | |
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
/opt/local/bin/ruby -Ilib:test "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" | |
/opt/local/bin/ruby -Ilib:test "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" | |
/opt/local/bin/ruby -Ilib:test "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" |
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
→ grep -Rn :default vendor/rails/railties/lib/tasks/* | |
vendor/rails/railties/lib/tasks/misc.rake:1:#task :default => :test |
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
#!/usr/bin/perl | |
# change your account, username, password, and group | |
# it'll run every time you commit (not push, mind you) | |
$account='account'; | |
$username='username'; | |
$password='password'; | |
$group='group'; | |
$git_text = `git log -n1 --pretty=format:"(%h) %s"`; |
OlderNewer