Skip to content

Instantly share code, notes, and snippets.

View cpb's full-sized avatar
🏠
Working from home

Caleb Buxton cpb

🏠
Working from home
View GitHub Profile
@cpb
cpb / Bash log
Last active December 23, 2015 18:29
I am having problems provisioning to aws.
$ vagrant box add ubuntu http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
Downloading or copying the box...
Extracting box...te: 2942k/s, Estimated time remaining: 0:00:01)
The box you're attempting to add already exists:
Name: ubuntu
Provider: virtualbox
$ vagrant box list
ubuntu (virtualbox)
@cpb
cpb / gist:6640924
Created September 20, 2013 17:26
successful results
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /app_path
@cpb
cpb / gist:6227768
Created August 14, 2013 03:29
cucumber-rails failures
Failing Scenarios:
cucumber features/capybara_javascript_drivers.feature:22 # Scenario: Use a particular driver
cucumber features/capybara_javascript_drivers.feature:44 # Scenario: Mixed DB access
cucumber features/choose_javascript_database_strategy.feature:30 # Scenario: Set the strategy to truncation and run a javascript scenario.
cucumber features/emulate_javascript.feature:3 # Scenario: See a widget
cucumber features/mongoid.feature:6 # Scenario: Keep Mongoid happy
cucumber features/multiple_databases.feature:62 # Scenario: Default transactional strategy is not attempted on second database
cucumber features/multiple_databases.feature:71 # Scenario: Truncation strategy is used on the second database
@cpb
cpb / repo.sh
Last active December 20, 2015 20:08 — forked from paulspencerwilliams/repo.sh
#/usr/bin/env ruby
rails new BugReproduce -T
cd BugReproduce
echo "group :test do" >> Gemfile
echo " gem 'cucumber-rails'" >> Gemfile
echo " gem 'rspec-rails'" >> Gemfile
echo " gem 'database_cleaner'" >> Gemfile
echo "end" >> Gemfile
echo "group :development do" >> Gemfile
@cpb
cpb / tweet.json
Last active December 17, 2015 21:30
Brief example of illustrating how a tweet might be represented in application/hal+json
{
"_links": {
"self": {
"href": "https://twitter.com/calebbuxton/status/328995716200558592" },
"reply": {
"href": "https://twitter.com/i/tweet/create?in_reply_to_status_id=328995716200558592" },
"favourite": {
"href": "https://twitter.com/i/tweet/favorite?id=328995716200558592" }
},
@cpb
cpb / .zshrc
Created March 13, 2013 20:52
Good to add to your raspberry pi's shell rc
# TMUX
if which tmux 2>&1 >/dev/null; then
# if no session is started, start a new session
test -z ${TMUX} && (tmux attach || tmux new-session)
# when quitting tmux, try to attach
while test -z ${TMUX}; do
tmux attach || break
done
fi
@cpb
cpb / plus1.bash
Last active December 11, 2015 02:49
Unfortunately, this is the bulk of my work these days
#!/bin/bash
read -p "Branch? " branch
echo
git co $branch
git pull origin $branch
git rebase az/master
read -p "Clean rebase? " -n 1 rebase
echo
<a href="chrome://chrome/settings/pointer-overlay#mouse">click here</a>
@cpb
cpb / matrix_multiplication.scad
Last active December 11, 2015 00:58
Matrix Multiplication Operator Question
rotation_z180 = [
[cos(180), -sin(180), 0, 0],
[sin(180), cos(180), 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]];
rotation_x90 = [
[1, 0, 0, 0],
[0, cos(90), sin(90), 0],
[0, -sin(90), cos(90), 0],
@cpb
cpb / notifier.coffee
Created August 11, 2012 22:14 — forked from sishen/notifier.coffee
Web Notifications integration in Pragmatic.ly
class Notifier
constructor: ->
@enableNotification = false
@checkOrRequirePermission()
hasSupport: ->
window.webkitNotifications?
requestPermission: (cb) ->
window.webkitNotifications.requestPermission (cb)