Skip to content

Instantly share code, notes, and snippets.

View rayfranco's full-sized avatar

Franco Bouly rayfranco

View GitHub Profile
@rayfranco
rayfranco / gist:2022406
Created March 12, 2012 14:46
CSS: Natural Box layout
/* apply a natural box layout model to all elements */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
// usage: log('inside coolFunc',this,arguments);
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
@rayfranco
rayfranco / gist:2020976
Created March 12, 2012 09:55 — forked from padolsey/gist:527683
Javascript: IE Detection
var ie = (function(){
var undef,
v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]