Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
describe GroupsController do
include SessionTestHelper
describe "GET 'show'" do
it "should load the group from the database" do
@the_group = Factory(:group)
Group.stub(:find_active_by_unique_name).with("london-developers").
and_return(@the_group)
require 'spec_helper'
describe GroupsController do
include SessionTestHelper
describe "GET 'show'" do
it "should load the group from the database" do
@the_group = Factory(:group)
Group.stub(:find_active_by_unique_name).with("london-developers").
and_return(@the_group)

Note to Self

Be With Your Mom

that's where i be

Be Confident

Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended

@bkerley
bkerley / sunburst.el
Created February 10, 2009 17:02 — forked from 53cr/sunburst.el
(defun color-theme-sunburst ()
(interactive)
(color-theme-install
'(color-theme-sunburst
((background-color . "#000000")
(foreground-color . "#FFFFFF")
(cursor-color . "#DAD085"))
(default ((t (nil))))
(modeline ((t (:background "DarkRed" :foreground "white"
:box (:line-width 1 :style released-button)))))
> ruby /tmp/version.rb
1.8.6
> cat /tmp/version.rb
puts VERSION
> rvm use 1.8.7 -S /tmp/version.rb
Now using ruby 1.8.7 p249
# wrote it, didn't try it
module TWSS
class Body
def initialize(text)
@text = text
end
def sentences
@text.split(/\?|\.|\;/).map{ |s| Sentence.new(s) }
@bkerley
bkerley / grep_safe.rb
Created November 22, 2010 03:56 — forked from capotej/grep_safe.rb
# turns hey => "[h]ey"
def grep_safe(path)
"[#{path.chars.first}]#{path.chars.to_a.slice(1, path.chars.count).join}"
end
@bkerley
bkerley / gist:1163607
Created August 22, 2011 21:15 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job:
Rails developer
Favorite Python project:
NodeBox
Favorite Conference:
Scottish Ruby Conference
Python Experience Level:
/*This code for a PIC12F615 compiles in mikroC for PIC http://www.mikroe.com
It takes an analog value from a dash-mounted potentiometer and drives a MOSFET proportional to the input. The MOSFET pulses the low-side of a blower motor in
a 1997 Mitsubishi Mirage, providing 128 speeds*/
void main() {
int anin=0, ramped=255;
unsigned long temp = 0;
@bkerley
bkerley / 1.txt
Created February 21, 2012 02:34 — forked from anonymous/1.txt
title New Browser Setup
User->Phone: identifying info
Phone->idjump: identifying info
idjump->Phone: encrypted blob
User->Phone: decrypting info
Phone->local storage: decrypted blob