Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Berkopec nateberkopec

View GitHub Profile
View gist:9328553
fatal: protocol error: expected old/new/ref, got 'shallow 0334aa796da397827fd2e43eb4af3c4b9ac0dff0'
! Heroku Git error, please try again shortly.
! See http://status.heroku.com for current Heroku platform status.
! If the problem persists, please contact http://help.heroku.com and provide Request ID e1d65557-16d7-4608-9a02-f5eccb9911b9.
fatal: The remote end hung up unexpectedly
View cards.md
  • Whip of Erebos
  • Spear of Heliod
  • Agent of the Fates
  • Ashen Rider
  • Boon Satyr
  • Champion of Stray Souls
  • Chromanticore
  • Eidolon of Countless Battles
  • Ephara, God of the Polis
  • Erebos, God of the Dead
View gist:9901201
RUBY_GC_HEAP_FREE_SLOTS: 600000
RUBY_GC_HEAP_GROWTH_FACTOR: 1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS: 200000
RUBY_GC_HEAP_INIT_SLOTS: 600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR: 1.3
RUBY_GC_MALLOC_LIMIT: 16000000
RUBY_GC_MALLOC_LIMIT_MAX: 32000000
RUBY_GC_OLDMALLOC_LIMIT: 16000000
RUBY_GC_OLDMALLOC_LIMIT_MAX: 32000000
View gist:81a69bc37b1483aaa4d9
$ bundle exec rake guides:generate WARNINGS=1; bundle exec rake guides:validate
.../.rbenv/versions/2.1.0/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
Generating 2_3_release_notes.md as 2_3_release_notes.html
Generating 3_0_release_notes.md as 3_0_release_notes.html
Generating 3_1_release_notes.md as 3_1_release_notes.html
Generating 3_2_release_notes.md as 3_2_release_notes.html
Generating 4_0_release_notes.md as 4_0_release_notes.html
Generating 4_1_release_notes.md as 4_1_release_notes.html
Generating _license.html.erb as _license.html
View gist:80589be918ad43057c8f
$ bundle exec rake guides:generate
.../.rbenv/versions/2.1.0/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
Generating 2_3_release_notes.md as 2_3_release_notes.html
Generating 3_0_release_notes.md as 3_0_release_notes.html
Generating 3_1_release_notes.md as 3_1_release_notes.html
Generating 3_2_release_notes.md as 3_2_release_notes.html
Generating 4_0_release_notes.md as 4_0_release_notes.html
Generating 4_1_release_notes.md as 4_1_release_notes.html
Generating _license.html.erb as _license.html
View base_controller.rb
class Admin::BaseController < ApplicationController
end
View gist:36dcd175fb8eca91950c
food idea list
tortillas
peanut butter
instant coffee
instant oatmeal
foil packet: potatoes, chicken, fish
ramen
canned chicken, turkey
mac and cheese
View gist:233da4fd0c2bb50d97a5
Add Sentry to your Gemfile:
gem "sentry-raven", :require => 'raven', :git => "https://github.com/getsentry/raven-ruby.git"
Add a config/initializers/raven.rb containing:
Raven.configure do |config|
config.dsn = 'https://ee561c4bd99f45c6bb2a442b1af04677:34f0a36cb8f54ca7beb35aaed895725f@app.getsentry.com/31964'
end
View split_a_text_message.rb
def prepare_bodies(message)
messages = message.scan(/.{1,130}\b/)
return messages if messages.length == 1
messages.each_with_index.map do |s, i|
"(#{i + 1}/#{messages.length}) #{s}"
end
end
View gist:f757f518a09c887dd7b3
class Order < ActiveRecord::Base
has_one :payment
def complete
payment.complete
end
end
class Payment < ActiveRecord::Base
belongs_to :gateway_transaction
def complete