Skip to content

Instantly share code, notes, and snippets.

View jwright's full-sized avatar
🤡
Compliance will be rewarded with hats.

Jamie Wright jwright

🤡
Compliance will be rewarded with hats.
View GitHub Profile
@jwright
jwright / gist:3684242
Created September 9, 2012 13:17
Bundle error when running bundle install for Sorcery
~/Projects/sorcery/spec> bundle
Bundler could not find compatible versions for gem "oauth2":
In Gemfile:
oauth2 (~> 0.6.0) ruby
sorcery (>= 0.1.0) ruby depends on
oauth2 (0.7.1)
@jwright
jwright / gist:3723858
Created September 14, 2012 18:43
Sorcery rake output
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.3)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
@jwright
jwright / creating_a_contact_test.rb
Created June 20, 2013 17:05
MiniTest ActiveRecord Model Assertions
# Let's say you have the following feature test
# test/features/creating_a_contact_test.rb
require 'test_helper'
describe 'Creating a new contact Feature Test' do
before { visit new_contact_path }
scenario 'entering valid data' do
@jwright
jwright / gist:6348272
Created August 27, 2013 00:15
Webmock mocking problem

Output

Failure/Error: subject.save html, filename
     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: PUT https://api-content.dropbox.com/1/files_put/auto/blog/processed/stuff.html?overwrite=true with body '<p>This is <em>great</em>, yo</p>
       ' with headers {'Accept'=>'*/*', 'Authorization'=>'Bearer blah', 'Content-Length'=>'34', 'Content-Type'=>'application/octet-stream', 'User-Agent'=>'OfficialDropboxRubySDK/1.6.1'}

       You can stub this request with the following snippet:
@jwright
jwright / tools.md
Last active August 29, 2015 13:57
Tools

Hardware

Puter

Mid 2012 MacBook Pro 15" Retnia. 2.3 i7 with 16GB of RAM.

Monitor

27" Apple Cinema Display.

@jwright
jwright / videos.rb
Created March 12, 2014 21:59
Sample Data
series = ChallengeVideoSeries.create name: 'Year One', break: 7
ChallengeVideo.create day: 0, week_number: 0, video_title: 'Member Orientation', video_key: '65860414', daycode: '486c3d2854', series_id: series.id, video_description: "You now have in your possession the most powerful achievement system ever created, and it can change your life. Whether you want to make more money, get in shape, pay off debts, or improve your relationships, The 12 Week YearTM Challenge is designed to get you there. <br /><br />A core idea that you will come to know intimately is: "High performance and goal achievement is all about execution!" <br /><br /> What separates you from the life you desire is not a lack of knowledge, or intellect, or strategy, or ideas -- but a lack of execution.<br /><br /> The Orientation Guide will get you started on your amazing 12 Week Year.<br /><br /> Download the guide and watch the video to get started!"
ChallengeVideo.create day: 0, week_number: 0, video_title: 'Vision', video_key: '658594

I hereby claim:

  • I am jwright on github.
  • I am jwright (https://keybase.io/jwright) on keybase.
  • I have a public key whose fingerprint is CDD1 1F53 28FC 923B 2C19 D411 017E FA47 DD36 1052

To claim this, I am signing this object:

{
@jwright
jwright / yosemite.md
Last active October 25, 2018 05:49
Yosemite Install

Yosemite Install

This is a fresh install of Yosemite and the steps I took to get my machine back up and running.

Prepare

  1. Make a backup on TimeMachine. Fucking hope that it worked
  2. Ensure that Dropbox has everything synced
  3. Make sure there was nothing needed in the ~/Downloads directory
  4. Make sure there was no code that needed to be pushed to GitHub from the ~/Projects directory
@jwright
jwright / gist:0420ba0adb163f6b4d89
Created December 10, 2014 23:41
Rake task to generate an empty Sequel migration
namespace :db do
desc "Create a migration with NAME="
task :create_migration do
name = ENV["NAME"]
if name.nil?
puts 'You must specify a migration name (e.g. rake db:create_migration NAME=create_events)!'
exit false
end
@jwright
jwright / gist:3a8587ec7e97da587d6e
Created June 9, 2015 19:06
Copy database from production to staging on Heroku
git remote add staging git@heroku.com:my-staging-app.git
git remote add production git@heroku.com:my-production-app.git
heroku pg:backups restore `heroku pg:backups public-url --remote production | cat` DATABASE --remote staging