Skip to content

Instantly share code, notes, and snippets.

@JamesHayton
JamesHayton / rails content_for caching
Created February 14, 2012 04:44 — forked from stackng/rails content_for caching
make action and fragment caching of rails3 compatible with content_for
module ActionController
class Metal
attr_internal :cached_content_for
end
module Caching
module Actions
def _save_fragment(name, options)
return unless caching_allowed?
@JamesHayton
JamesHayton / gist:1862587
Created February 19, 2012 08:15 — forked from jacquescrocker/gist:1318784
google cloud print pointers
# this works with oauth 0.5.1
client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
:authorize_url => "/o/oauth2/auth",
:token_url => "/o/oauth2/token",
:site => 'https://accounts.google.com/')
redirect_uri = "#{SERVER_URL}/oauth2callback"
get '/auth' do