Skip to content

Instantly share code, notes, and snippets.

View skmetz's full-sized avatar

Sandi Metz skmetz

View GitHub Profile
# coderay formatting
# once you paste this into blogger, you MAY have to surround the block with a
# div class='hscroll' to get a horizontal scrollbar.
# Usage:
# Copy your ruby code into the paste buffer,
# run this ruby code to format it
# paste the newly formatted code into your blog.
require 'rubygems'
# dep_inj_1.rb
def this
end
#!/bin/bash
PROJ="/Users/skm/Projects/test"
for d in `ls -d */` # get a list of all directories
do
DIR=${d/\//} # replace trailing / with nothing as in ${stringZ/replacethis/withthis}
TARGET_DIR="$PROJ/vendor"
#!/bin/bash # test change
DATE=`date +%m-%e-%y`
OUTPUT="versions_as_of_$DATE.txt"
rm "$OUTPUT"
for d in `ls -d */` # get a list of all directories
do
DIR=${d/\//} # replace trailing / with nothing as in ${stringZ/replacethis/withthis}
GITDIR_ARG="--git-dir=$DIR/.git"
# If model Thing has fields name, description and photo ...
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
describe "resource(:things)" do
describe "a successful POST" do
before(:each) do
Thing.all.destroy!
file = File.new(File.join('path_to_test_photos',"thing_photo.jpg"))