Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View paul's full-sized avatar

Paul Sadauskas paul

View GitHub Profile
@paul
paul / railsconf.md
Last active June 1, 2016 15:52
RailsConf 2016

Overview

Traveled by motorcycle (1300 miles roundtrip) from Boulder, CO to Kansas City, MO and back again.

Schedule

Wednesday

  • Keynote (Jeremy Daer)
  • Didn't find this keynote to be of much value. It meandered and ran over allotted time.
require "benchmark/ips"
require "active_support/callbacks"
class NormalMethod
def before
:before
end
<section>
<h1>{{title}}</h1>
<p>{{text}}</p>
</section>
@paul
paul / gold_plating.rb
Last active March 15, 2016 22:45
An implementation of the Conductor Pattern
module GoldPlating
extend ActiveSupport::Concern
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
included do
extend ActiveModel::Callbacks
define_model_callbacks :validation
@paul
paul / gist:8164116
Created December 28, 2013 20:57
turnip rspec 3 beta spec failure
1) The CLI shows the correct description
Failure/Error: @result.should include('A simple feature')
expected "\nAmbiguous\n This is an ambiguous feature\n this is ambiguous (FAILED - 1)\n\nFailures:\n\n 1) Ambiguous This is an ambiguous feature this is ambiguous\n Failure/Error: Given this is ambiguous\n Turnip::Ambiguous:\n Ambiguous step definitions\r\n - \"this is ambiguous\" (/Users/rando/Code/librato/multipass/vendor/turnip/lib/turnip/dsl.rb:8:in `step')\r\n - \"this is :ambiguous\" (/Users/rando/Code/librato/multipass/vendor/turnip/lib/turnip/dsl.rb:8:in `step')\n # ./lib/turnip/execute.rb:17:in `step'\n # ./lib/turnip/rspec.rb:44:in `run_step'\n # ./lib/turnip/rspec.rb:72:in `block (6 levels) in run'\n # ./lib/turnip/rspec.rb:71:in `each'\n # ./lib/turnip/rspec.rb:71:in `block (5 levels) in run'\n # /Users/rando/.gem/ruby/2.1.0/gems/rspec-core-3.0.0.beta1/lib/rspec/core/example.rb:114:in `instance_exec'\n # /Users/rando/.gem/ru
{
"@context": {
"vocab": "http://www.markus-lanthaler.com/hydra/api-demo/vocab#",
"hydra": "http://www.w3.org/ns/hydra/core#",
"ApiDocumentation": "hydra:ApiDocumentation",
"property": {
"@id": "hydra:property",
"@type": "@id"
},
"readonly": "hydra:readonly",
@paul
paul / gist:4262547
Created December 11, 2012 21:51
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…
test long
Boo!
@paul
paul / output
Created September 24, 2012 19:42
personal/hypercacher - [master] » rspec spec/acceptance/response_cache_control_spec.rb
Hypercacher response Cache-Control header
is not present
the first request
should be OK (code 200)
should be authoritative
the second request
should be OK (code 200)
should not be authoritative
@paul
paul / _README.mkd
Created July 15, 2012 22:19
A better pretty_json.rb

Installation

  1. Copy prissy to ~/bin (or elsewhere in your $PATH)
  2. chmod +x prissy
  3. gem install awesome_print multi_json

Usage

$ some_command_that_outputs_json | prissy