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/sh | |
args="-d" | |
CURRENT=`git branch | grep "\*" | cut -d' ' -f2` | |
while [ $# -gt 0 ]; do | |
case "$1" in | |
-f|-D|--force) | |
args=${args/-d/-D} | |
;; |
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
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 |
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:" |
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
(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 { |
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
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 |
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
~/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 |
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
From 96932cf367ae29f1b69dc9d0e703deb9cd7f9ed4 Mon Sep 17 00:00:00 2001 | |
From: Brian Donovan <[email protected]> | |
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 |
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) |
OlderNewer