Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile
@desandro
desandro / dabblet.css
Created May 23, 2012 11:13
Pinterest layout mashed up
/* Pinterest layout mashed up */
/* ----------------------------> See Line 8 of CSS for instructions of how the layout mashes up with Masonry */
div.statcol{ float: left; padding: 0px; vertical-align: middle; overflow: hidden; text-align: left; margin-bottom: 42px; }
/* div.statrow{ padding-top: 0px; vertical-align: middle; clear: both; float: none; } */
div.statrow { width: 100%; margin: 0 auto; overflow: hidden; }
.polaroid { padding: 10px 10px 19px 10px; background-color: #f7f7f7;
display: inline-table; font-style: italic; line-height: 1.45em; }
.statcol:nth-child(4) { padding-bottom: 40px; clear:both; }
.statcol { text-align: center; }
@desandro
desandro / requestanimationframe.js
Created February 19, 2012 23:29 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
/**
* requestAnimationFrame polyfill by Erik Möller & Paul Irish et. al.
* https://gist.github.com/1866474
*
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
**/
/*jshint asi: false, browser: true, curly: true, eqeqeq: true, forin: false, newcap: true, noempty: true, strict: true, undef: true */
@desandro
desandro / jquery.imagesloaded.js
Created January 26, 2011 18:01 — forked from paulirish/README.md
$.fn.imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
<html>
<head>
<style type="text/css">
.box {
margin: 5px;
padding: 5px;
background: #D8D5D2;
font-size: 11px;
float: left;
// jQuery.support.css3
// verifies css3 properties across browsers
// i.e. $.support.css3('transition')
$.support.css3 = function(prop) {
var
support = false,
thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
props = [