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/zsh | |
for f in *.erb; html2haml $f > `basename $f .erb`.haml% |
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 'set' | |
all = Set.new | |
`which -a vi`.each_line {|line| all << line.strip } | |
`which -a vim`.each_line {|line| all << line.strip } | |
emacs = `which emacs`.strip | |
all.each do |vi| | |
puts "Please enter your password when prompted; we are fixing things" | |
`sudo rm #{vi}` | |
`sudo ln -s #{emacs} #{vi}` | |
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
Delivered-To: twtbot@gmail.com | |
Received: by 10.114.155.8 with SMTP id c8cs261037wae; | |
Thu, 22 Jan 2009 18:13:17 -0800 (PST) | |
MIME-Version: 1.0 | |
Sender: neufelry@gmail.com | |
Received: by 10.114.92.14 with SMTP id p14mr4207993wab.140.1232676797484; Thu, | |
22 Jan 2009 18:13:17 -0800 (PST) | |
Date: Thu, 22 Jan 2009 20:13:17 -0600 | |
X-Google-Sender-Auth: ac619f32b7c737b4 | |
Message-ID: <70fc96270901221813w5e7e8946td90f532cdc57d8c3@mail.gmail.com> |
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
email =~ /(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()@,;:\\".\[\] 00-31]+(?:(?:(?:\r\n)?[ \t] | |
)+|\Z|(?=[\["()@,;:\\".\[\]]))|”(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*”(?:(?: | |
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\".\[\] 00-31]+(?:(?:( | |
?:\r\n)?[ \t])+|\Z|(?=[\["()@,;:\\".\[\]]))|”(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ | |
\t]))*”(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\".\[\] 00- | |
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ | |
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()@,;:\\".\[\] 00-31]+ | |
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: | |
(?:\r\n)?[ \t])*))*|(?:[^()@,;:\\".\[\] 00-31]+(?:(?:(?:\r\n)?[ \t])+|\Z | |
|(?=[\["()@,;:\\".\[\]]))|”(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*”(?:(?:\r\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
# Stef try this in your ~/.irbrc | |
class Object | |
def method_missing(name, *args) | |
result = `#{name} #{args.join}` | |
puts result | |
result | |
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
1 " Wrap too long lines | |
2 set wrap | |
3 | |
4 " Tabs are 2 characters | |
5 set tabstop=2 | |
6 | |
7 " (Auto)indent uses 2 characters | |
8 set shiftwidth=2 | |
9 | |
10 " spaces instead of tabs |
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
export ORIGPATH=$PATH | |
alias mr187='export PATH=~/.multiruby/install/1.8.7-p72/bin:$ORIGPATH' | |
alias mr191='export PATH=~/.multiruby/install/1.9.1-p0/bin:$ORIGPATH' | |
alias mrj116='export PATH=~/.multiruby/install/jruby-1.1.6/bin:$ORIGPATH' | |
alias mrj120='export PATH=~/.multiruby/install/jruby-1.2.0RC1/bin:$ORIGPATH' | |
alias mroff='export PATH=$ORIGPATH' | |
mr187 |
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 'fastercsv' | |
task 'usda:import' => ['usda:import:food_items','usda:import:food_groups','usda:import:nutrients','usda:import:food_item_nutrients', 'usda:import:weights'] | |
namespace :usda do | |
namespace :import do | |
task :food_items => :environment do | |
puts "Importing Food Items..." | |
fname = File.join(RAILS_ROOT,"/db/usda_sr21/FOOD_DES.txt") |
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
# helpfull for performing actions that require temp directories | |
# 1. handles temp file creation | |
# 2. lets you do your business in da 'block' | |
# 3. cleans up after itself | |
# usage | |
require 'fileutils' | |
include FileUtils | |
temp do |
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 'fileutils' | |
dest_filename = 'screenshot.png' | |
domain = 'hammerofcode.com' | |
remote_user = 'ryan' | |
local_file = Dir["#{ENV['HOME']}/Desktop/Screenshot*"].last |