Skip to content

Instantly share code, notes, and snippets.

View johnbeynon's full-sized avatar

John Beynon johnbeynon

View GitHub Profile
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: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.
(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)
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
<%= f.input :password, :input_html => { :class => "span3" }, :placeholder => "password", :hint => "Forgot your #{link_to "password", new_password_path(resource_name)}?".html_safe %>
>> 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
>> 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...
>,
Loading development environment (Rails 3.2.0.rc2)
>> Photo.last
Photo Load (0.9ms) SELECT "photos".* FROM "photos" ORDER BY "photos"."id" DESC LIMIT 1
#<Photo:0x007fabb4fb0da8> {
:id => 15,
:user_id => 1,
:yacht_id => 11,
:image => "DSCF2077.jpeg",
:primary => false,
:created_at => Fri, 30 Dec 2011 09:16:48 UTC +00:00,
GIT
remote: git://github.com/jnicklas/carrierwave.git
revision: 181620a505b45e1a9b919278a213036a4fd7c89f
specs:
carrierwave (0.5.8)
activesupport (>= 3.0)
GEM
remote: http://rubygems.org/
specs:
@johnbeynon
johnbeynon / heroku.coffee
Created November 12, 2011 22:19
Heroku Hubot Script
# A limited way to interact with the Heroku API.
#
# INSTALLATION:
# 1. Create file in scripts folder in hubot folder
# 2. Update package.json for hubot and add dependency on "sprintf": "0.1.1"
# 3. Set heroku config variable HEROKU_USER to heroku user account to use
# 4. Set heroku config variable HEROKU_APIKEY to heroku user account apikey (from My Account page)
#
# heroku status - Retrieve the most recent tweet from the @herokustatus account
# heroku ps --app <appname> - Get process information for application