This file contains 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
include_recipe "apt" | |
apt_repository "brightbox" do | |
uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu' | |
distribution node.lsb.codename | |
components ['main'] | |
keyserver "keyserver.ubuntu.com" | |
key "C3173AA6" | |
action :add | |
end |
This file contains 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
// ZOMG!! | |
['11','11','11','11'].map(parseInt) | |
//=> [11, NaN, 3, 4] | |
// Fixing JavaScript foibles with delicious curry! | |
['11','11','11','11'].map(curry(parseInt)); | |
//=> [11, 11, 11, 11] |
This file contains 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
# If capybara cannot find your browser executable, you can give it a hint like so: | |
Selenium::WebDriver::Firefox.path='/Applications/Firefox.app/Contents/MacOS/firefox-bin' | |
Selenium::WebDriver::Chrome.path = "/opt/google/chrome/google-chrome" |
This file contains 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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
This file contains 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
#!/usr/bin/env ruby | |
# Description | |
# Starts the rails environment in a long running process that forks a test | |
# runner. The test begins running immediately as the rails environment | |
# has already been loaded. Useful when running a single spec over and over. | |
# The program will exit when a change is detected | |
# in the Gemfile, or the db, config, lib and vendor directories. | |
# |
This file contains 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
-- from http://veritrope.com/code/copy-omnifocus-item-uri-to-evernote/ | |
tell front window of application "OmniFocus" | |
try | |
set theTrees to selected trees of content | |
if (count of theTrees) < 1 then | |
set theTrees to selected trees of sidebar | |
end if | |
if (count of theTrees) < 1 then |
This file contains 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
def maybe_a_sandwich | |
nil | |
end | |
# Methods that might return nil are annoying. We want to write a nice | |
# confident chain: | |
result = nil | |
result = maybe_a_sandwich.add_horseradish.get_into_my_belly! rescue $! | |
result # => #<NoMethodError: undefined method `add_horseradish' for nil:NilClass> |
This file contains 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
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
This file contains 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
#!/bin/bash | |
PARTY_DIR=subpop_cascadia | |
command -v curl || (echo "No curl in path." && exit 1) | |
mkdir -p $PARTY_DIR | |
cd $PARTY_DIR | |
curl -O https://s3.amazonaws.com/subpop-public/assets/audio/JAMIFEST.txt |
This file contains 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
### | |
Helps creating and submitting forms | |
- easy labeling | |
- automatically inserts values of the model to the form | |
- is able to serialize forms to JSON | |
- can submit the form to the server | |
- automatically displays errors if there are any | |
### | |
class FormHelper | |