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
drewwells / gist:4219907
Created Dec 5, 2012
Webkit+Moz detect device pixel ratio
View gist:4219907
var ratio = window.devicePixelRatio ||
(function(i){
var wmq = window.matchMedia;
while( !window.devicePixelRatio && i > 0 &&
!wmq("(min--moz-device-pixel-ratio:" + i/10 + ")").matches ){
i=i-1;
}
return i/10;
})(30);
@quamen
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
end
You can’t perform that action at this time.