Skip to content

Instantly share code, notes, and snippets.

def complete_facebook_connect
within_window "Log In | Facebook" do
fill_in 'Email:', with: fb_user.email
fill_in 'Password:', with: fb_user.password
click_button "Log In"
# syncronization makes this never return, maybe because
# it's running in a different window?
without_resyncronize { click_button "Allow" }
end
end
@kinsteronline
kinsteronline / rack_example.ru
Created December 8, 2011 16:12 — forked from mattetti/rack_example.ru
Very basic rack application showing how to use a router based on the uri and how to process requests based on the HTTP method used.
#########################################
# Very basic rack application showing how to use a router based on the uri
# and how to process requests based on the HTTP method used.
#
# Usage:
# $ rackup rack_example.ru
#
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas
# $ curl localhost:9292/ideas
@kinsteronline
kinsteronline / rails31init.md
Created December 29, 2011 14:16 — forked from dallas/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Simple Form, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@kinsteronline
kinsteronline / gist:1712153
Created January 31, 2012 18:47
Log Death
Started GET "/patients/324383/pharmacies/search?search%5Bnew_pharmacy%5D=true&search%5Bpatient_id%5D=324383&search%5Bprescription_id%5D=20902571" for 173.24.225.166 at 2012-01-31 18:45:31 +0000
Processing by PharmaciesController#search as */*
Parameters: {"search"=>{"new_pharmacy"=>"true", "patient_id"=>"324383", "prescription_id"=>"20902571"}, "patient_id"=>"324383"}
User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 422 LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 422 LIMIT 1
(0.3ms) BEGIN
(0.5ms) UPDATE "users" SET "last_request_at" = '2012-01-31 18:45:31.894869', "perishable_token" = '7KVh2qvR9hLREHoss8ei', "updated_at" = '2012-01-31 18:45:31.896128' WHERE "users"."id" = 422
(2.8ms) COMMIT
Pharmacy Load (1.9ms) SELECT "pharmacies".* FROM "pharmacies" INNER JOIN "prescriptions" ON "prescriptions"."pharmacy_id" = "pharmacies"."id" INNER JOIN "medications" ON "medications"."id" = "prescriptions"."medication_id" INNER JOIN "patients" ON "p
@kinsteronline
kinsteronline / gist:1838254
Created February 15, 2012 19:14
monkey patched efax
module EFax
class QueryStatus
RESOURCE_NOT_FOUND = 2
end
class OutboundStatusResponse
alias_method :original_initialize, :initialize
def initialize(response)
@kinsteronline
kinsteronline / hack.sh
Created March 19, 2012 14:12 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@kinsteronline
kinsteronline / customer.rb
Created May 16, 2012 20:34
Authorization states in a Proc
class Customer < AR::Base
authorization_states = Proc.new do
event :start_authorizing do
transition all => :authorizing
end
event :finish_authorizing do
transition :authorizing => :authorized
end
exports[key] = value for key, value of {
run : run
document : document
parse : parse
resolveSource : resolveSource
version : version
defaults : defaults
languages : languages
}
@kinsteronline
kinsteronline / fairly_standard.rb
Created December 20, 2012 16:57
Rails template that includes mysql, rspec, guard and fabrication.
gem 'unicorn'
gem_group :development, :test do
gem 'rspec-rails'
gem 'ffaker'
end
gem_group :development do
gem 'guard'
gem 'rb-inotify', require: false
doctype 5
html
head
meta(charset='utf-8')
title= title
block css
body
block content
block js