Skip to content

Instantly share code, notes, and snippets.

View h-lame's full-sized avatar
💀
a momentary diversion on the road to the grave

Murray Steele h-lame

💀
a momentary diversion on the road to the grave
View GitHub Profile
module Scoring
def self.included(base)
base.class_eval do
let(:__score_keeper) { ScoreKeeper.new }
extend ScoreHelpers
include ScoreMatchers
end
end
class ScoreKeeper
@h-lame
h-lame / .hgrc
Created December 3, 2013 19:22
My hgrc, with these plugins and options I basically replicated a close to git workflow.
[ui]
verbose = True
merge = diffmerge
[pager]
pager = LESS='FSRX' less
[extensions]
pager =
color =
@h-lame
h-lame / featured_topics_and_policies.js
Created April 10, 2013 11:45
Cope with the fact that what we clone: a) has chosen selects in it that don't like being cloned - we remove their chosen artifacts and re-chosen()-ify them b) has hidden chosen selects in it that don't re-render properly if they were hidden - we do the same thing that we do on initial load and wait for all of them to declare they are ready befor…
module TicketProcessing
class TicketHTMLGenerator
def initialize(ticket)
@ticket = ticket
end
def generate!
renderer.render(context)
end
@h-lame
h-lame / rename_model.rb
Created June 6, 2012 08:40
Model rename refactor script. (From @threedaymonk)
#!/usr/bin/env ruby
class Renamer
attr_reader :from, :to
def initialize(from, to)
@from = from
@to = to
end
@h-lame
h-lame / growlnotificationswithmessagesforcampfireandfluid.user.js
Created November 9, 2011 10:00
Campfire notifications via growl (for fluid browsers) (Updated for prototype 1.7)
// ==UserScript==
// @name Growl Notifications with messages for campfire and fluid
// @namespace http://tim.theenchanter.com/
// @description If your name is mentioned in a message, a growl notification shows what was said.
// @author Tim Harper, Murray Steele (modifications for prototype 1.7)
// @homepage http://tim.theenchanter.com/
// @include *.campfirenow.com/room*
// ==/UserScript==
try { if ( typeof(Campfire) != "undefined" ) {
@h-lame
h-lame / transfobot.bas
Created September 17, 2011 08:50
Transfobot from McSweeney's #38
10 DIM R$(24,1),A(5),B(5),Z(5)
20 CLS: WIDTH 40: KEY OFF: SCREEN 0,1
30 LOCATE 12,16,0:COLOR 7:PRINT "Stand by..."
40 FOR H=0 TO 1:FOR I = 1 TO 24
50 R$(I,H)="":C=0
60 READ T,KO:R$(I,H)+CHR$(T)+CHR$(KO)
70 C=C+T:IF C<17 THEN 60
80 NEXT I,H
90 FOR I=1 TO 5: READ A(I), B(I):Z(I)=0:NEXT I
100 CLS: FOR K=1 TO 5:GOSUB 1000: NEXT K
Feature: There should be monsters in my dungeon
In order to manage what types of monsters are available to my dungeons
As a dungeon master
I want to be able to see a list of monsters, add new ones, edit them and also delete them
Scenario: Adding a monster to my list of monsters available to my dungeons
Given I am on the new monster page
When I fill in "Name" with "Orc"
And I select "very" from "Scariness"
And I press "Create"
require 'rubygems'
fetcher = Gem::SpecFetcher.fetcher
my_dep = 'activesupport'
# 1st arg = all (true to get all versions, false to get latest)
# 2nd arg = prerelase (true to get pre-release gems, false to get stable)
all_gems = fetcher.list(false, false)
Amazon: $1,000 - $3,000
Play.com: $100 - $1,000,000
John Lewis: $1,000,000 - $2,000,000
HMV: $10 - $250
Toys'r'Us: $50 - $2,000