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
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!" |
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 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) |
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 | |
# "@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 |
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
var checkboxImage, | |
checkboxAlternateImage, | |
checkboxCheckedImage, | |
checkboxCheckedAlternateImage; | |
@implementation CheckboxButton : CPButton | |
{ | |
BOOL _isChecked; | |
} |
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
#!/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:" |