Skip to content

Instantly share code, notes, and snippets.

View eventualbuddha's full-sized avatar

Brian Donovan eventualbuddha

View GitHub Profile
#!/bin/sh
args="-d"
CURRENT=`git branch | grep "\*" | cut -d' ' -f2`
while [ $# -gt 0 ]; do
case "$1" in
-f|-D|--force)
args=${args/-d/-D}
;;
describe Advert do
before do
@owner = User.new
@advert = Advert.new(:user => @owner)
end
describe "permissions" do
describe "for anonymous users" do
before do
@user = nil
#!/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:"
var checkboxImage,
checkboxAlternateImage,
checkboxCheckedImage,
checkboxCheckedAlternateImage;
@implementation CheckboxButton : CPButton
{
BOOL _isChecked;
}
(function($) {
$.fn.clippy = function(text, bgcolor) {
if (!bgcolor) {
var node = $(this);
while (node.css('background-color') == 'transparent' && node.length) {
node = node.parent();
}
if (!node.length) {
bgcolor = '#ffffff';
} else {
@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
gem install rmagick
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.3.5... yes
checking for HDRI disabled version of ImageMagick... yes
~/Desktop $ env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
From 96932cf367ae29f1b69dc9d0e703deb9cd7f9ed4 Mon Sep 17 00:00:00 2001
From: Brian Donovan <brian@wesabe.com>
Date: Thu, 17 Sep 2009 18:08:20 -0700
Subject: [PATCH] Fix typo.
---
activemodel/lib/active_model/errors.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
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)