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
#recursively require all files in directory (and subdirectories) | |
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each {|file| require file } | |
#recursively require all files in directory but skip paths that match a pattern | |
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each do |file| | |
require file unless file =~ /\/model\// | |
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
svn stat | grep "^\?" | awk '{print $2}' | xargs svn add |
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 | |
NTW = { | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", | |
7 => "seven", |
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 | |
NTW = { | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", | |
7 => "seven", |
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
#put this in .bashrc | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " *" | |
} | |
export PS1='[\u@\h \W\[\e[1;35m\]$(__git_ps1 " (%s$(parse_git_dirty))")\[\e[0;39m\]]\$ ' |
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 'terminal-table/import' | |
class SubsetSumMatrix | |
class << self | |
def create_empty_for(array) | |
matrix = [] | |
header = [nil] + build_header_from(array) | |
matrix << header | |
array.each_with_index do |element,i| | |
row = header.collect{|value| 'F'} |
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
# Hoptoad integration example. | |
task "deploy:before" => "isolate:dotgems" do | |
if /\.gems/ =~ `git status` | |
abort "Changed gems. Commit '.gems' and deploy again." | |
end | |
ENV["TO"] = Deploy.env | |
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
# Ensure AssetTagHelper has been loaded before we try to monkey-patch it. | |
require 'action_view/helpers/asset_tag_helper' | |
module ActionView::Helpers::AssetTagHelper | |
# Insert the asset id in the filename, rather than in the query string. In | |
# addition to looking nicer, this also keeps any other static file handlers | |
# from preempting our Rack::StaticCache middleware, since these | |
# version-numbered files don't actually exist on disk. | |
def rewrite_asset_path(source) | |
source.insert source.rindex('.'), "-#{rails_asset_id(source)}" |
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 | |
#need irbtools gem isntalled for all these to be pulled in | |
#need irbtools-more gem isntalled for all these to be pulled in | |
#you probably want these in rvm global gemset so it get pulled into all the rubies | |
require 'rubygems' unless defined? Gem # only needed in 1.8 | |
require 'irbtools/configure' | |
Irbtools.remove_library(:hirb) | |
Irbtools.remove_library(:boson) | |
Irbtools.remove_library(:wirb) |
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
{ | |
":type": "application/vnd.playup.extension+json", | |
":uid": "tile.photo.featured.1", | |
":display": { | |
":self": "http://www.zombo.com/tileupdates.json", | |
":type": "application/vnd.playup.display.feature.photo+json", | |
"summary": "Photo Feature\nLorem ipsum dolor sit amet, consectetur adipisicing elit", | |
"image": "http://www.footballfedvic.com.au/uploads/pics/BoxHill_South_Emily_Web.jpg", | |
"footer_title": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", | |
"footer_subtitle": "Where sport gets social", |
OlderNewer