Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile

Configuration

The Bower configuration alters the behaviour of Bower on the local system.

The config is obtained by merging multiple configurations by this order of importance: [cli args via --config.*] environment variables local bowerrc located in the cwd all bowerrc files upwards the directory tree bowerrc file located in the home folder

for ( var _i = 0; _i < 10 * 10; _i++ ) {
var i = Math.floor( _i / 10 );
var j = _i % 10;
console.log(i, j);
}
// Original by John Hann
// http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
function debounce( fn, threshold ) {
var timeout;
return function debounced() {
var _this = this;
var args = arguments;
if ( timeout ) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@desandro
desandro / jquery.isotope-masonry-column-shift-layout-mode.js
Created November 1, 2013 12:45
masonryColumnShift Layout mode for Isotope v1
// custom layout mode
$.Isotope.prototype._masonryColumnShiftReset = function() {
// layout-specific props
var props = this.masonryColumnShift = {
columnBricks: []
};
// FIXME shouldn't have to call this again
this._getSegments();
var i = props.cols;
props.colYs = [];
@desandro
desandro / README.md
Created September 24, 2013 12:26
imagesLoaded + requireJS

Install imagesLoaded via Bower

bower install imagesloaded

The config in main.js can be set up several ways

requirejs.config({
  // set paths object
  paths: {

Drag this link to your bookmarks

/*!
* Packery PACKAGED v1.0.6
* bin-packing layout library
* http://packery.metafizzy.co
*
* Commercial use requires one-time purchase of a commercial license
* http://packery.metafizzy.co/license.html
*
* Copyright 2013 Metafizzy
*/

After 7 years of being a customer of A Small Orange, I plan on switching this week.

Earlier last week, I was emailed by A Small Orange. See email.txt in this gist.

What's was going was that on here is that my account is experiencing a huge spike in activity. The script in question is my Mint analytics.

What I believe is happening is that someone has copy/pasted some code from the Isotope, Packery, or Masonry site, and deployed it in a site with huge scale. That, or, my own sites are experiencing a huge spike in traffic.

My account has been suspended. I have no access to my sites -- FTP, SSH, or control panel. All my sites display this page:

// 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() {