This file contains hidden or 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
# watchr specs.watchr | |
watch( '^spec/(.*)\/(.*)\_spec.rb' ){ |m| run( "rspec spec/#{m[1]}/#{m[2]}_spec.rb") } | |
watch( '^(.*)\/(.*)\.rb') { |m| run( "rspec spec/#{m[1]}/#{m[2]}_spec.rb") } | |
watch( '(.*)\.rb' ) { |m| run( "rspec spec/#{m[1]}_spec.rb" ) } | |
watch( 'spec/(.*)\_spec.rb' ) { |m| run( "rspec spec/#{m[1]}_spec.rb" ) } | |
watch( '^spec/spec_helper\.rb' ) { run( "rspec spec" ) } | |
def run(cmd) | |
puts(cmd) |
This file contains hidden or 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
String.prototype.format = function() { | |
var formatted = this; | |
for (var i = 0; i < arguments.length; i++) { | |
var regexp = new RegExp('\\{'+i+'\\}', 'gi'); | |
formatted = formatted.replace(regexp, arguments[i]); | |
} | |
return formatted; | |
}; |
This file contains hidden or 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
" }}} | |
" Nyan! ------------------------------------------------------------------- {{{ | |
function! NyanMe() " {{{ | |
hi NyanFur guifg=#BBBBBB | |
hi NyanPoptartEdge guifg=#ffd0ac | |
hi NyanPoptartFrosting guifg=#fd3699 guibg=#fe98ff | |
hi NyanRainbow1 guifg=#6831f8 | |
hi NyanRainbow2 guifg=#0099fc | |
hi NyanRainbow3 guifg=#3cfa04 |
This file contains hidden or 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 | |
# this ran fine on Debian-6.0.3-i386-netboot. | |
# Not tested it on anything else so enlighten me.. | |
clear | |
echo "======== installing required packages" | |
echo | |
sudo apt-get install g++ |
This file contains hidden or 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
config.vm.provision :chef_solo do |chef| | |
chef.cookbooks_path = "cookbooks" | |
chef.add_recipe "vim" | |
chef.add_recipe "tree" | |
chef.add_recipe "mono" | |
chef.add_recipe "git" | |
end |
This file contains hidden or 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
def export_as_csv | |
model = MyModel.all | |
filename = params[:action] + ".csv" | |
if request.env['HTTP_USER_AGENT'] =~ /msie/i | |
headers['Pragma'] = 'public' | |
headers["Content-type"] = "text/plain" | |
headers['Cache-Control'] = 'no-cache, must-revalidate, post-check=0, pre-check=0' | |
headers['Content-Disposition'] = "attachment; filename=\"#{filename}\"" | |
headers['Expires'] = "0" |