Skip to content

Instantly share code, notes, and snippets.

@muellerj
muellerj / gist:1229134
Created September 20, 2011 14:02 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@muellerj
muellerj / orders_controller.rb
Created January 24, 2011 07:31
PDFKit on Heroku with single Dyno
# ...
def show_pdf
@order = Order.find_by_token(params[:id])
if @order.nil?
flash[:error] = "Couldn't find invoice."
redirect_to root_path
else
pdf = PDFKit.new(render_to_string(:action => 'show', :id => @order.token, :layout => "invoice"))
pdf.stylesheets << "#{Rails.root}/public/stylesheets/invoice.css"