Skip to content

Instantly share code, notes, and snippets.

Stef Lewandowski stefl

Block or report user

Report or block stefl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
drewwells / gist:4219907
Created Dec 5, 2012
Webkit+Moz detect device pixel ratio
View gist:4219907
var ratio = window.devicePixelRatio ||
var wmq = window.matchMedia;
while( !window.devicePixelRatio && i > 0 &&
!wmq("(min--moz-device-pixel-ratio:" + i/10 + ")").matches ){
return i/10;
quamen / cached_resource.rb
Created Apr 29, 2011
Module that adds read through caching to ActiveResource with fallback to a permanent cache
View cached_resource.rb
require 'active_support/concern'
module CachedResource
extend ActiveSupport::Concern
included do
class << self
alias_method_chain :find, :cache
You can’t perform that action at this time.