Skip to content

Instantly share code, notes, and snippets.

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
@fogus
fogus / fixing-parseInt.js
Last active December 11, 2015 17:49
All this and more in Lemonad and in fine bookstores and libraries near you!
// 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]
@karledurante
karledurante / gist:2581543
Created May 2, 2012 23:18
webdriver path config
# 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"
@devsigner
devsigner / rbenv-install-system-wide.sh
Created March 28, 2012 09:52 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p125 on Debian 6 Squeeze
# 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
@sandro
sandro / pass.rb
Created February 21, 2012 20:26
Preforking spec runner - like spork.
#!/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.
#
@nicksieger
nicksieger / Send to Evernote.scpt
Created January 1, 2012 23:48 — forked from turadg/Send Chrome to OmniFocus.scpt
OmniFocus integrations
-- 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
@avdi
avdi / when.rb
Created December 5, 2011 22:17
Experimenting with Object#when in Ruby
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>
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
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
@deanh
deanh / gist:1112154
Created July 28, 2011 18:15
Get some jamz
#!/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
@tdegrunt
tdegrunt / formhelper.coffee
Created May 24, 2011 19:28 — forked from janmonschke/formhelper.coffee
Simple FormHelper that works well with Backbone.js Models
###
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