Skip to content

Instantly share code, notes, and snippets.

View rounders's full-sized avatar

Francois Harbec rounders

View GitHub Profile
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@rounders
rounders / gist:2962628
Created June 20, 2012 22:30 — forked from jmcnevin/gist:2558928
Installing REE with RVM, Homebrew, XCode 4.3+ on OS X Lion
# Rather than going nuclear and downgrading Xcode or using some other big GCC installer,
# this worked for me...
# From https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
# Path may vary slightly...
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
# If you've attempted to install REE previously and it failed...
@rounders
rounders / gist:1159978
Created August 21, 2011 01:46 — forked from parndt/gist:1011435
How to cache pages and clear them in Refinery CMS
# put in config/application.rb
config.to_prepare do
::PagesController.module_eval do
caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? }
caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? }
end
::Page.module_eval do
after_save :clear_static_caching!
after_destroy :clear_static_caching!