Skip to content

Instantly share code, notes, and snippets.

View stuartchaney's full-sized avatar
💥

Stuart Chaney stuartchaney

💥
View GitHub Profile
@stuartchaney
stuartchaney / keybase.md
Created January 2, 2018 17:50
keybase.md

Keybase proof

I hereby claim:

  • I am stuartchaney on github.
  • I am stuartchaney (https://keybase.io/stuartchaney) on keybase.
  • I have a public key whose fingerprint is 3AEB 0C0D 2538 14B5 EC23 549F 1876 64E8 A29C 88ED

To claim this, I am signing this object:

1. a) replace variable.price with wh_price
b) DO NOT replace inside of script tags
c) Only replace if inside {{ }} or {% %}
{{variable.price}} <!-- replace this with --> {{wh_price}}
{{random_stuff | times: 1 | variable.price}} <!-- replace this with --> {{random_stuff | times: 1 | wh_price}}
{% variable.price %} <!-- replace this with --> {% wh_price %}
<script type="text/javascript">
{{variable.price}} <!-- DONT REPLACE THIS -->
@stuartchaney
stuartchaney / nested_hmt_patch.rb
Last active December 27, 2015 05:29
Updated for newest version of nested_form gem
module NestedForm
module BuilderMixin
def link_to_add_hmt(*args, &block)
options = args.extract_options!.symbolize_keys
association = args.pop
association_two = args.pop
unless object.respond_to?("#{association}_attributes=")
raise ArgumentError, "Invalid association. Make sure that accepts_nested_attributes_for is used for #{association.inspect} association."
end
<!DOCTYPE html>
<html>
<head>
<title>Airbrakeiojs</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
<script type="text/javascript">
//<![CDATA[
var notifierJsScheme = (("https:" == document.location.protocol) ? "https://" : "http://");
2012-03-14T03:45:48+00:00 app[web.1]: Time for request: 107 microseconds.
2012-03-14T03:45:48+00:00 heroku[router]: POST api.airbrake.io/notifier_api/v2/notices dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=138
2012-03-14T03:45:48+00:00 heroku[nginx]: 173.228.102.130 - - [14/Mar/2012:03:45:48 +0000] "POST /notifier_api/v2/notices HTTP/1.1" 200 133 "-" "Apache-HttpClient/4.1.2 (java 1.5)" api.airbrake.io
Stus-MacBook-Air:hoptoad stuchaney$ bundle install
Fetching source index for http://rubygems.org/
/Users/stuchaney/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:428:in `request': too many connection resets (http://rubygems.org/quick/Marshal.4.8/pry-0.9.7.4-i386-mingw32.gemspec.rz) (Gem::RemoteFetcher::FetchError)
# here are the settings that are common to all environments
common: &default_settings
api-key: <default api-key - can be one of production or staging>
production:
api-key: <production api-key>
enabled: true
staging:
api-key: <staging api-key>
Unable to generate a Rails application:
ruby -rrubygems -rthread -e "gem 'rails', '3.0.0'; load Gem.bin_path('rails', 'rails', '3.0.0')" new rails_root
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rails (= 3.0.0) amongst [activesupport-3.1.1, airbrake-3.0.5, builder-3.0.0, multi_json-1.0.3] (Gem::LoadError)
from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems.rb:1195:in `gem'
from -e:1
(RuntimeError)
./features/step_definitions/rails_application_steps.rb:25:in `/^I generate a new Rails application$/'
features/rails.feature:16:in `When I generate a new Rails application'
Welcome to Ubuntu 11.04 (GNU/Linux 2.6.38-8-virtual i686)
* Documentation: https://help.ubuntu.com/
System information as of Mon Nov 7 18:46:16 UTC 2011
System load: 0.0 Processes: 59
Usage of /: 94.9% of 7.87GB Users logged in: 0
Memory usage: 41% IP address for eth0: 10.244.250.74
Configuration:
http_read_timeout: 5
api_key: "c1182fee990a5c9d6dd80e2427904bab"
user_information: "Airbrake Error {{error_id}}"
notifier_version: "3.0.4"
rescue_rake_exceptions: nil
ignore: ["ActiveRecord::RecordNotFound", "ActionController::Rou
backtrace_filters: [#<Proc:0x000000010122b558@/usr/local/rvm/gems/ree-1.8.
params_filters: ["password", "password_confirmation"]
framework: "Rails: 3.0.9"