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 Capybara::Driver
class Envjs
PreTypingEvents = ['focus']
TypingEvents = ['keydown', 'keypress', 'keyup']
PostTypingEvents = ['change', 'blur']
def self.type_into(field, value)
PreTypingEvents.each { |e| field.trigger(e) }
field.set(value)
TypingEvents.each { |e| field.trigger(e) }
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'date'
#location = 'http://www.howdoesitfeel.co.uk/podcast.html'
location = './podcast.html'
module PublishingLogic
module Migrations
class AddProgrammes < ActiveRecord::Migration
def self.up
create_table :programmes do |t|
t.boolean :publishing_enabled
t.datetime :published_at
t.datetime :published_until
t.timestamps
end
Feature: Allowing users to vote for an answer
As a visitor to the FAQ site
I want to be able to vote for the answer I think is best
In order to crowd-source the question having the most relevant answer
Scenario: I can vote for an answer
Given there is a question "What is jam?"
And it has been answered "Lovely sticky fruit stuff, best smeared on toast"
And it has been answered "A problem with too much traffic"
When I am on the page for question "What is jam?"
Company A: $1,000 - $3,000
Company B: $6,000 - $10,000
Company C: $500 - $2,500
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
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)
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"
@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
@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" ) {