This file contains hidden or 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
set conf_name to text returned of ¬ | |
(display dialog ¬ | |
"Enter conference name:" with title ¬ | |
"Schedule Conference" default answer ¬ | |
"" default button 2) | |
tell application "OmniFocus" | |
tell default document | |
set newProject to make new project with properties {name:conf_name} | |
This file contains hidden or 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
require 'download_policy' | |
describe DownloadPolicy do | |
let(:screencast) { stub(:free? => false) } | |
let(:anonymous_user) { nil } | |
let(:user_with_access) { stub(:has_screencast_access? => true) } | |
let(:user_without_access) { stub(:has_screencast_access? => false) } | |
it "is disallowed for anonymous users" do | |
subject.allow_download_for?(screencast, anonymous_user).should be_false |
This file contains hidden or 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
I want to give a lightning talk about: | |
"Wat?" | |
I need the projector: yes / no | |
Yes |
This file contains hidden or 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 Delegator | |
takes :request, :route_path, :resource, :delegate_name | |
let(:delegate_method) { @resource.record_class.method(method_name) } | |
let(:method_name) { @delegate_name.split('.').last.to_sym } | |
def delegate | |
delegate_method.call(*delegate_args) | |
end |
This file contains hidden or 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
Given /^I'm subscribed as a group host for ([^ ]*) users?$/ do |users| | |
users = users.to_i | |
steps %Q{ | |
Given I'm on the account page | |
Given I enter valid billing details | |
} | |
choose("for_many") # THIS FAILS | |
fill_in "people ($9 per month each)", :with => users | |
steps('And I press "Subscribe"') | |
end |
This file contains hidden or 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
CantTouchThis = Class.new do | |
def to_s | |
'<CantTouchThis>' | |
end | |
end.new | |
class Stripper | |
def self.strip(klass) | |
klass.class_eval do | |
Stripper::constants_to_remove.each do |c| |
This file contains hidden or 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
# mock-based (interaction) | |
# db independent, but tied to implementation (I can change the AR call without affecting the behavior and this will fail) | |
context "data gathering" do | |
it "finds all indicators associated with the given sector and includes indicators not associated with any sectors" do | |
sector = stub_model(Sector, :id => 6) | |
Indicator.should_receive(:where).with("sector_id is null or sector_id = ?", sector.id) | |
Indicator.for_sector(sector) | |
end |
This file contains hidden or 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
module Rack | |
module Utils | |
def parse_nested_query(qs, d = nil) | |
params = ActiveSupport::OrderedHash.new | |
(qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p| | |
k, v = unescape(p).split('=', 2) | |
normalize_params(params, k, v) | |
end |
This file contains hidden or 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
task :cron => :environment do | |
DatabaseBackup.back_up_to_s3! | |
end |
This file contains hidden or 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
$grid_column_width: 40px | |
$grid_column_margin: 10px | |
$grid_columns: 12 | |
$grid_width: $grid_columns * ($grid_column_width + $grid_column_margin * 2) | |
=container | |
margin-left: auto | |
margin-right: auto | |
width: $grid_width | |