Skip to content

Instantly share code, notes, and snippets.

View gabebw's full-sized avatar

Gabe Berke-Williams gabebw

View GitHub Profile
@gabebw
gabebw / gist:748934
Created December 20, 2010 20:32
rvm --trace --default 1.8.7
$ alias sed
sed='sed -E'
$ rvm --trace --default 1.8.7
+__rvm_parse_args:424> [[ -z 4.3.9 ]]
+__rvm_parse_args:581> [[ -z '' && -n '' ]]
+__rvm_parse_args:583> [[ 0 -eq 1 || -n '' ]]
+__rvm_parse_args:15> [[ -n --default ]]
+__rvm_parse_args:17> rvm_token=--default
+__rvm_parse_args:19> [[ 1 -gt 0 ]]
+__rvm_parse_args:19> next_token=1.8.7
@gabebw
gabebw / gist:750420
Created December 21, 2010 19:25
rvm --trace reload
scripts $ rvm --trace reload
+__rvm_parse_args:424> [[ -z 4.3.9 ]]
+__rvm_parse_args:581> [[ -z '' && -n '' ]]
+__rvm_parse_args:583> [[ 0 -eq 1 || -n '' ]]
+__rvm_parse_args:15> [[ -n reload ]]
+__rvm_parse_args:17> rvm_token=reload
+__rvm_parse_args:19> [[ 0 -gt 0 ]]
+__rvm_parse_args:19> next_token=''
+__rvm_parse_args:21> case reload (fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env)
+__rvm_parse_args:23> rvm_action=reload
@gabebw
gabebw / sbcl_error.sh
Created January 21, 2011 15:12
Error installing sbcl - I've <cut> compilations that finished successfully, though I didn't <cut> packages with only style warnings
[ruby-1.9.2] $ brew install -v sbcl
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe
CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe
MAKEFLAGS: -j2
==> Downloading http://downloads.sourceforge.net/project/sbcl/sbcl/1.0.44/sbcl-1.0.44-source.tar.bz2
File already downloaded and cached to /Users/gabe/Library/Caches/Homebrew
context "with parsed time" do
before do
@time = output.first.time
end
subject { @time }
its(:year){ should == 2007 }
its(:month){ should == 9 }
its(:day){ should == 16 }
its(:hour){ should == 8 }
@gabebw
gabebw / 0_failure_output.sh
Created June 25, 2011 18:31
Intermittent capybara-webkit failures
$ rake spec:javascripts --trace
** Invoke spec:javascripts (first_time)
** Execute spec:javascripts
>> "Visit"
>> 1
>> 43
>> "http://127.0.0.1:65427/run/notifier_spec.js"
<< "ok\n"
@gabebw
gabebw / rake_task_spec.rb
Created July 13, 2011 16:13
Test Rake task
require 'spec_helper'
describe "Rake tasks" do
def fake_rake_application
app = Rake::Application.new
Rake.application = app
Rake::Task.define_task('environment'){}
app
end
@gabebw
gabebw / javascript.diff
Created July 13, 2011 20:42
JS refactoring
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index e30ed18..d7b0745 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -6,22 +6,31 @@
*
*/
+function zeroPad(number){
+ number = parseInt(number, 10);
commit e72463f0c2fc2799a89595e4de5f8e26e918c187
Author: Gabe Berke-Williams <gabe@thoughtbot.com>
Commit: Gabe Berke-Williams <gabe@thoughtbot.com>
When creating a task, select the current user, and ensure it's first.
Selenium (i.e Firefox) might have selected the options where the selected
attribute was an empty string, or Iora.users might not have had current_user
first. This fixes both problems.
commit e72463f0c2fc2799a89595e4de5f8e26e918c187
Author: Gabe Berke-Williams <gabe@thoughtbot.com>
Commit: Gabe Berke-Williams <gabe@thoughtbot.com>
When creating a task, select the current user, and ensure it's first.
Selenium (i.e Firefox) might have selected the options where the selected
attribute was an empty string, or Iora.users might not have had current_user
first. This fixes both problems.
commit e72463f0c2fc2799a89595e4de5f8e26e918c187
Author: Gabe Berke-Williams <gabe@thoughtbot.com>
Commit: Gabe Berke-Williams <gabe@thoughtbot.com>
When creating a task, select the current user, and ensure it's first.
Selenium (i.e Firefox) might have selected the options where the selected
attribute was an empty string, or Iora.users might not have had current_user
first. This fixes both problems.