Skip to content

Instantly share code, notes, and snippets.

# Use this template to report PaperTrail bugs.
# It is based on the ActiveRecord template.
# https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
Updating heroku client ..
Updating Heroku v4 CLI to 4.27.15-535a059 (master)... panic: open /Users/jared/.heroku/heroku-cli.new: no such file or directory
goroutine 3 [running]:
main.fileSha1(0xc8204780f0, 0x23, 0x0, 0x0)
/Users/jdickey/src/github.com/heroku/heroku-cli/update.go:209 +0xb8
main.updateCLI(0x48fadc, 0x6)
/Users/jdickey/src/github.com/heroku/heroku-cli/update.go:121 +0x57e
main.Update.func1(0x48fadc, 0x6, 0xc82001a600)
/Users/jdickey/src/github.com/heroku/heroku-cli/update.go:61 +0x30
@jaredbeck
jaredbeck / student_teams.rb
Created January 20, 2016 04:44
Partitioning students into teams, brute force approach
require 'pp'
require 'set'
# Which days are students available?
STUDENTS = [
# Mon. Tue. Wed. Thurs. Fri.
[ true, true, false, false, false], # Student 1
[ true, false, false, false, false], # Student 2
[false, true, true, false, false], # etc ...
[false, true, false, true, true],
@jaredbeck
jaredbeck / pt_issue_594.rb
Created January 8, 2016 06:10
PaperTrail issue 594, reproduced
# https://github.com/airblade/paper_trail/issues/594
# Use this template to report PaperTrail bugs.
# It is based on the ActiveRecord template.
# https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
@jaredbeck
jaredbeck / pt_issue_663.rb
Created January 8, 2016 04:58
PaperTrail Issue 663 - Unable to reproduce
# https://github.com/airblade/paper_trail/issues/663
# Use this template to report PaperTrail bugs.
# It is based on the ActiveRecord template.
# https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
@jaredbeck
jaredbeck / gist:3148368
Created July 20, 2012 02:51
Disable rspec verbosity
# Turn off rspec verbosity, so that the
# resultant rspec command, and all the
# spec names, are not echoed to stdout.
# See http://bit.ly/MoOoB3 -Jared 2012-07-19
if defined? RSpec
task(:spec).clear
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
end
end
@jaredbeck
jaredbeck / crash
Created June 12, 2013 21:04
qt5 - webkit_server cannot find QtWebKit
Process: webkit_server [4641]
Path: /Users/USER/*/webkit_server
Identifier: webkit_server
Version: ???
Code Type: X86-64 (Native)
Parent Process: ruby [4637]
User ID: 501
Date/Time: 2013-06-12 17:00:06.378 -0400
OS Version: Mac OS X 10.8.3 (12D78)
@jaredbeck
jaredbeck / heroku_pull.rb
Last active December 18, 2015 05:29
A script to export a heroku database and overwrite the specified local database
#!/usr/bin/env ruby
#
# `Puller` exports a heroku database, and overwrites the specified
# local database. See "Importing and Exporting Heroku Postgres
# Databases with PG Backups" (http://bit.ly/15Udpfl)
# -Jared Beck 2013-06-07
#
class Puller
def initialize args
@jaredbeck
jaredbeck / ruby_introspection.md
Created May 28, 2013 00:41
Use `source_location` to find where a method is defined

TL;DR

Use ruby's [Method#source_location][1] to determine where a method is defined.

method(:s).source_location
# => ["..snip../gems/sexp_processor-4.2.1/lib/sexp.rb", 332]
@jaredbeck
jaredbeck / Gemfile
Created April 23, 2013 18:23
Ruby bug 8308 supporting files
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '3.2.13'
gem 'pg'
gem 'taps'
# Web server
gem 'unicorn'