Skip to content

Instantly share code, notes, and snippets.

View johnbeynon's full-sized avatar

John Beynon johnbeynon

View GitHub Profile
>> Photo.last
Photo Load (0.5ms) SELECT "photos".* FROM "photos" ORDER BY "photos"."id" DESC LIMIT 1
#<Photo:0x007ff115e1a358> {
:id => 15,
:user_id => 1,
:yacht_id => 11,
:image => #<ImageUploader:0x7ff115e195e8
@storage = #<CarrierWave::Storage::Fog:0x7ff115e18a80
attr_reader :uploader = ...ImageUploader...
>,
>> Photo.last.image
Photo Load (1.2ms) SELECT "photos".* FROM "photos" ORDER BY "photos"."id" DESC LIMIT 1
"DSCF2077.jpeg"
>> Photo.last.image.thumb
Photo Load (0.4ms) SELECT "photos".* FROM "photos" ORDER BY "photos"."id" DESC LIMIT 1
NoMethodError: undefined method `thumb' for "DSCF2077.jpeg":String
from (irb):2
<%= f.input :password, :input_html => { :class => "span3" }, :placeholder => "password", :hint => "Forgot your #{link_to "password", new_password_path(resource_name)}?".html_safe %>
if defined?(Bundler)
# If you have a Gemfile, require the gems listed there, including any gems
#gems you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups(:assets => %w{development test}))
end
(select distinct drugs.name
from drugs
where drugs.name NOT IN (select distinct drugs.name from drugs where drugs.customer_id is NOT NULL))
union all
(select distinct drugs.name
from drugs
where drugs.customer_id is NOT NULL)
@johnbeynon
johnbeynon / gist:3948629
Created October 24, 2012 20:25
TDDIUM > Heroku minus the Heroku gem
require 'heroku-api'
def cmd(c)
system c
end
namespace :tddium do
desc "post_build_hook"
task :post_build_hook do
# This build hook should only run after CI builds.
language: ruby
rvm:
- 1.9.2
before_install:
- sudo curl -C - -O http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
- sudo tar -xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
- sudo mv wkhtmltopdf-i386 /usr/bin/wkhtmltopdf
@johnbeynon
johnbeynon / gist:4284757
Created December 14, 2012 11:25
My Heroku wishlist....
1. Safe Harbour
Why? To be able to host my apps with Heroku and meet current EU rulings on data storage
2. MultiRegion
Why? US-East Amazon. Enough said. Most apps we build are for EU customers so to be able to have the application closer to the end user is always a good thing.
3. Clearer way to identify owned versus collaborated apps in the dashboard
kyan/sage/sop[kyan_addons]% fudge build
Running build default
Running task yard {:arguments=>"-r YardREADME.md", :coverage=>100}
[warn]: @param tag has unknown parameter name: Optional
in file `sop_ui/lib/sop_ui/document.rb' near line 34
[warn]: Unknown tag @params in file `sop_ui_components/lib/sop_ui_components/widgets/menu.rb` near line 30
[warn]: Unknown tag @rescue in file `sop_support/lib/sop_support/event_tracking/event_tracker.rb` near line 12
[warn]: @param tag has unknown parameter name: options
in file `sop_support/lib/sop_support/event_tracking/event_tracker.rb' near line 12
[warn]: in YARD::Handlers::Ruby::MixinHandler: Undocumentable mixin: YARD::Parser::UndocumentableError for class SopAuthentication::AuthProviders::Sageid
@johnbeynon
johnbeynon / gist:5465651
Last active December 16, 2015 16:49
Chambers

Chambers Skip Hire Guildford

Dear Sir/Madam,

I should like report inappropriate behaviour from the driver of one of your blue skip collection vehicles (empty at the time) that had turned right onto Grange Road off Stoughton Road in Guildford this morning at approximately 7:23am.

Your vehicle had stopped behind the parked vehicles that adorn Grange Road on their side of the road, I was travelling at speed on my bike in the opposite direction when your vehicle decided to pull out into my path and as we approached was using far more of the road that was needed and forced me to mount the pavement. As we passed I was subjected to verbal abuse of which I only caught 'I pay bloody tax' being shouted at me.

I should be grateful if you could pass onto your drivers;