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)]/" | |
} | |
PS1="$PS1 \[$(parse_git_branch\]" |
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
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click* |
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
git status | grep deleted | while read line; do git rm ${line/"# deleted:"/}; done; |
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/env ruby | |
require 'rubygems' | |
require 'active_support' | |
require 'json' | |
require 'commander/import' | |
program :name, "xml2json" | |
program :version, "1.1.0" | |
program :description, "XML to JSON converter" |
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/bash | |
for model in `find app/models/ -type f`; do | |
model=${model:11}; | |
model=${model:0:(${#model}-3)}; | |
yes n | script/generate model $model; | |
done; |
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
class CreateFormPartial < ActiveRecord::Migration | |
def self.up | |
create_table :form_partials do |t| | |
t.string :persistence_hash, :null => false | |
t.binary :data, :null => false | |
t.boolean :saved, :default => false | |
t.references :user, :null => false | |
t.timestamps | |
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
// this allows culerity to wait until all ajax requests have finished | |
jQuery(function($) { | |
var original_ajax = $.ajax; | |
var count_down = function(callback) { | |
return function() { | |
try { | |
if(callback) { | |
callback.apply(this, arguments); | |
}; | |
} catch(e) { |
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
desc "Runs the test suite on the Integrity box" | |
task :integrity do | |
def exec_with_exit(command_str, put = false) | |
out = %x{#{command_str}} | |
puts out if put | |
exit($?.exitstatus) unless $? == 0 | |
end | |
ENV['PATH'] = "#{ENV['PATH']}:/usr/local/jruby/jruby-1.5.0/bin" |
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
*.pbxproj -crlf -diff -merge |
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
NSArray *allowedImageFileExtensions = [NSArray arrayWithObjects:@"png",@"jpg",@"jpeg",@"gif",@"bmp",nil]; | |
// ... | |
- (IBAction)displayImagePickerSheet:(id)sender { | |
NSOpenPanel *panel = [NSOpenPanel openPanel]; | |
[panel setAllowedFileTypes:allowedImageFileExtensions]; | |
[panel setDirectory:NSHomeDirectory()]; | |
[panel setAllowsMultipleSelection:NO]; | |
[panel setCanChooseDirectories:NO]; |
OlderNewer