Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile
@desandro
desandro / jquery.masonry-0.6.js
Created March 26, 2012 18:15
Early jQuery Masonry
(function($){
//Finding min and max values in array from http://snippets.dzone.com/posts/show/769
Array.prototype.min = function(){ return Math.min.apply({},this) };
Array.prototype.max = function(){ return Math.max.apply({},this) };
$.fn.masonry = function() {
this.each(function() {
var wall = $(this);
@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 */
// add event helper
function addEvent( obj, type, fn ) {
if ( obj.addEventListener ) {
obj.addEventListener( type, fn, false );
} else if ( obj.attachEvent ) {
obj.attachEvent( "on" + type, fn );
}
}
function cornifyThisGuy() {
function debounce( fn, threshold ) {
var timeout;
return function() {
clearTimeout( timeout );
var args = arguments;
var _this = this;
timeout = setTimeout( function() {
fn.apply( _this, args );
}, threshold || 100 );
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<style media="screen">
</style>
/* sidebars */
.Trends,
.wtf-module,
.RelatedUsers,
.SignupCallOut,
/* in timeline */
.wtf-module.has-content,
.tweet.dismissable-content,
.LiveVideoHomePageModuleContainer,
.WtfLargeCarouselStreamItem, /* WTF in timeline */
@desandro
desandro / get-style-property.js
Created January 24, 2013 15:37
getStyleProperty
/*!
* getStyleProperty by kangax
* http://perfectionkills.com/feature-testing-css-properties/
*/
/*jshint browser: true, strict: true, undef: true */
( function( window ) {
'use strict';
@desandro
desandro / candy-box-cheats.js
Last active February 2, 2019 00:39
candy box cheats
// http://candies.aniwey.net/
// enter in console
candies.nbrOwned = Number.POSITIVE_INFINITY;
lollipops.nbrOwned = Number.POSITIVE_INFINITY;
quest.setMaxLandOrder( 20 );
chocolateBars.nbrOwned = 10;
sword.specialPower = 100;
for ( var potionName in potions.list ) {
@desandro
desandro / README.md
Last active January 28, 2019 21:59
SCRIPT-8
/* sidebars */
.Trends,
.wtf-module,
.RelatedUsers,
.SignupCallOut,
/* in timeline */
.wtf-module.has-content,
.tweet.dismissable-content,
.LiveVideoHomePageModuleContainer,
.WtfLargeCarouselStreamItem, /* WTF in timeline */