- churn script:
git log --name-only | grep *.rb | sort | uniq -c | sort -nr | head
- Bread recipe for Jeff: http://www.youtube.com/watch?v=13Ah9ES2yTU
- Conway's law - Sarah Mei's RubyConf 2012 keynote http://www.confreaks.com/videos/1304-rubyconf2012-the-insufficiency-of-good-design
- Make smaller things (it's hard to err in the direction of too small, and you can always merge things together). Fred George,
This file contains 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
# 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")) |
This file contains 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 # 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" | |
This file contains 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 | |
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" | |
This file contains 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
# dep_inj_1.rb | |
def this | |
end |
This file contains 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
# 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' |
This file contains 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 164f12ca299a407d9d31f32e400daaef12ab736a Mon Sep 17 00:00:00 2001 | |
From: Sandi Metz <[email protected]> | |
Date: Mon, 15 Jun 2009 08:01:48 -0400 | |
Subject: [PATCH] remove case statements, use double dispatch | |
--- | |
actionpack/lib/action_view/helpers.rb | 2 + | |
actionpack/lib/action_view/helpers/form_helper.rb | 43 ++++++-------- | |
.../helpers/form_helper_core_extensions.rb | 59 ++++++++++++++++++++ | |
.../lib/action_view/helpers/prototype_helper.rb | 19 +------ |
This file contains 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 164f12ca299a407d9d31f32e400daaef12ab736a Mon Sep 17 00:00:00 2001 | |
From: Sandi Metz <[email protected]> | |
Date: Mon, 15 Jun 2009 08:01:48 -0400 | |
Subject: [PATCH] remove case statements, use double dispatch | |
--- | |
actionpack/lib/action_view/helpers.rb | 2 + | |
actionpack/lib/action_view/helpers/form_helper.rb | 43 ++++++-------- | |
.../helpers/form_helper_core_extensions.rb | 59 ++++++++++++++++++++ | |
.../lib/action_view/helpers/prototype_helper.rb | 19 +------ |
This file contains 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
class Bag < Hash | |
def add(obj) | |
increment_count(obj) | |
end | |
def increment_count(obj) | |
self[obj] = (cnt = self[obj]).nil? ? 1 : cnt + 1 | |
end | |
This file contains 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
# This simplest thing is to clone Jim's repo (https://github.com/jimweirich/gilded_rose_kata) and then | |
# put this file in the root directory. | |
gem 'minitest', '~> 4.7' | |
require "minitest/autorun" | |
require "minitest/reporters" | |
MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new | |
require_relative './gilded_rose' |
OlderNewer