Skip to content

Instantly share code, notes, and snippets.

View matthewcrist's full-sized avatar

Matthew Crist matthewcrist

View GitHub Profile
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
@matthewcrist
matthewcrist / gist:6187527
Created August 8, 2013 18:50
Symbolset Oops
Puma caught this error: Paypal::Exception::APIError
/home/deploy/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/paypal-express-0.5.3/lib/paypal/nvp/request.rb:57:in `handle_response'
/home/deploy/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/paypal-express-0.5.3/lib/paypal/nvp/request.rb:37:in `request'
/home/deploy/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/paypal-express-0.5.3/lib/paypal/express/request.rb:50:in `checkout!'
/home/deploy/symbolset/current/app/helpers.rb:266:in `paypal'
/home/deploy/symbolset/current/app/controllers.rb:200:in `post'
<main>:32:in `block in service'
<main>:32:in `catch'
<main>:32:in `service'
<main>:47:in `call'
@matthewcrist
matthewcrist / mongoid_active_model_initializer.rb
Created December 26, 2013 19:31
ActiveModel serializer with Mongoid
# config/initializers/mongoid_active_model_initializer.rb
Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
Mongoid::Criteria.delegate(:active_model_serializer, to: :to_a)
@matthewcrist
matthewcrist / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@matthewcrist
matthewcrist / ssl_puma.sh
Last active January 28, 2016 00:00 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 4096
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@matthewcrist
matthewcrist / readme.md
Created September 21, 2016 14:14
Auto height iFrames on Boston.gov

iFrames that resize based on the content of the page is possible for Boston.gov. In order to get them working, you will need to include a snippet of JS on the page that will be iframed. The code for this is:

<script>
    window.iFrameResizer = {
    targetOrigin: 'https://www.boston.gov'
  }
</script>
<script src="https://www.boston.gov/sites/all/themes/custom/boston_public/dist/js/resizer.client.js"></script>
/summon WitherBoss ~0 ~1 ~0 {Equipment:[{id:diamond_sword,tag:{Unbreakable:1,ench:[{id:18,lvl:5},{id:20,lvl:2},{id:19,lvl:2},{id:21,lvl:3},{id:16,lvl:5},{id:17,lvl:5},{id:34,lvl:3}]}},{id:diamond_boots,tag:{Unbreakable:1,ench:[{id:3,lvl:4},{id:8,lvl:3},{id:2,lvl:4},{id:1,lvl:4},{id:4,lvl:4},{id:0,lvl:4},{id:7,lvl:3},{id:34,lvl:3}]}},{id:diamond_leggings,tag:{ench:[{id:3,lvl:4},{id:1,lvl:4},{id:4,lvl:4},{id:0,lvl:4},{id:7,lvl:3},{id:34,lvl:3}]}},{id:diamond_chestplate,tag:{Unbreakable:1,ench:[{id:3,lvl:4},{id:1,lvl:4},{id:4,lvl:4},{id:0,lvl:4},{id:7,lvl:3},{id:34,lvl:3}]}},{id:diamond_helmet,tag:{Unbreakable:1,ench:[{id:6,lvl:1},{id:3,lvl:4},{id:1,lvl:4},{id:4,lvl:4},{id:0,lvl:4},{id:5,lvl:3},{id:7,lvl:3},{id:34,lvl:3}]}}],CustomName:Wither Storm,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:500},{Name:generic.movementSpeed,Base:1.0},{Name:generic.attackDamage,Base:10},{Name:generic.knockbackResistance,Base:500}],ActiveEffects:[{Id:22,Amplifier:1,Duration:999999},{Id:12,Amplifier:1,Duration:9999