Skip to content

Instantly share code, notes, and snippets.

View davidmontoyago's full-sized avatar

David Montoya davidmontoyago

  • Chicago
View GitHub Profile
@davidmontoyago
davidmontoyago / open-chrome-no-security
Last active December 29, 2015 00:19
Open new Chrome window with disabled security. Use it to execute JS apps without using a local app server and avoid the “Cross origin requests are only supported for HTTP.”
open -na "Google Chrome" --args --disable-web-security --user-data-dir=/tmp/junk
@davidmontoyago
davidmontoyago / inspect-with-tab-key
Last active December 25, 2015 19:39
Inspect dom elements in Chrome as you move with the Tab key.
$("body *").on('keydown', function(event) {
var keyCode = event.which;
if (keyCode == 9) {
console.log(event.target);
inspect(event.target);
}
event.stopPropagation();
});
@davidmontoyago
davidmontoyago / infinite-list-view.js
Last active December 21, 2015 16:49
Infinite scroll list view with Backbone.js - Got some inspiration from @kjantzer: https://gist.github.com/kjantzer/4021245
/**
* Extend for infinite scrolling capabilities.
*
* "addMore" function must be implemented in the child view.
* The infinite scrolling is disabled by default, must be enabled from the child view when initialized or ready.
*
* Uses jquery waypoints - http://imakewebthings.com/jquery-waypoints/
*
* Config options:
* - endOfList: id of the way-point element