Skip to content

Instantly share code, notes, and snippets.

View eventualbuddha's full-sized avatar

Brian Donovan eventualbuddha

View GitHub Profile
@eventualbuddha
eventualbuddha / s.fish
Created August 20, 2010 03:21 — forked from indirect/s.sh
function s -d "Easy spec running"
if grep -q "Rspec.configure" spec/spec_helper.rb
echo "rspec2!"
if test -z "$argv"
rspec -fs -c spec
else
rspec -fs -c $argv
end
else
echo "rspec1!"
def find_and_replace_in_source_files(find, replace)
puts "Search and replace #{find.inspect} => #{replace.inspect}"
extensions = %w[.rhtml .rxml .erb .builder .rb .css .js .rake]
files = Dir["**/*"]
files.each do |file_name|
next if (file_name =~ /^vendor/) || !extensions.include?(File.extname(file_name))
text = File.open(file_name, 'r'){ |file| file.read }
if text.gsub!(find, replace)
@eventualbuddha
eventualbuddha / @
Created September 8, 2009 14:32 — forked from bgreenlee/@
#!/bin/bash
# "@Pad"
# An easy commandline time-stamped log/notepad
# Derived from http://blog.rubybestpractices.com/posts/jamesbritt/James_will_be_right_back_after_these_interruptions.html
#
# Usage:
# @ something or other - log the timestamped message "something or other"
# @ . - open the @ scratchpad with a new timestamp and
# no message with your default editor
var checkboxImage,
checkboxAlternateImage,
checkboxCheckedImage,
checkboxCheckedAlternateImage;
@implementation CheckboxButton : CPButton
{
BOOL _isChecked;
}
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'cgi'
require 'hpricot'
files = Dir[File.join(ARGV[0], '*')]
unless files.any?
puts "Call this script with the name of a directory full of movie files you want to add years to. For example:"