Skip to content

Instantly share code, notes, and snippets.

View arkitrave's full-sized avatar

Eric Shepherd arkitrave

View GitHub Profile
// Gets the location in a grid of objects by numbered row and lettered column
// Example: 5C is the 5th row, 3rd column
getGridLocation = function($el) {
var $items = $el.find('.item:visible'),
index = $items.index($el),
lefts = [],
tops = [];
$items.each(function() {
var $item = $(this),
Date.prototype.beginningOfWeek = function () {
return new Date(this - ((this.getDay() - (arguments[0] || 0)) * 86400000));
}