This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('iframe:not(:visible)').remove(); | |
urls = ['https://edfuh.com', 'https://google.com']; i = 0; | |
[].slice.call(frames).forEach(function(f){ console.log(f.location.assign(urls[i++])) }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste into console and get a list of the amazon | |
var urls = {}; | |
[].slice.apply($$('a')).map(function(a) { | |
return a.href | |
}).filter(function(u) { | |
return /amazon.com/.test(u) | |
}).map(function(u) { | |
return u.split('?')[0] | |
}).forEach(function(u) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Template Loader. Used to asynchronously load templates located in separate .html files | |
window.templateLoader = { | |
load: function(views, callback) { | |
var deferreds = []; | |
$.each(views, function(index, view) { | |
if (window[view]) { | |
deferreds.push($.get('tpl/' + view + '.html', function(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Defining the application router, you can attach sub routers here. | |
var Router = Backbone.Router.extend({ | |
routes: { | |
"": "index" | |
}, | |
index: function() { | |
this.useLayout("main").setViews({ | |
header: new UI.Views.Toolbar() | |
}).render(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rgbToHex (r, g, b) { | |
return [].slice.apply(arguments).map(function (n) { | |
return n.toString(16); | |
}).join('').toUpperCase(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval( function(){ | |
document.body.style.zoom = ((+document.body.style.zoom || 1) + 0.01) | |
},1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keyExists = function(obj, structure) { | |
var F = function(){}; | |
F.prototype = obj; | |
var parts = structure.split('.'); | |
var testObj = new F; | |
for (var i = 0, j = parts.length; i < j; i++) { | |
if (!testObj[parts[i]]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Countdown(seconds, update, done) { | |
this.length = seconds; | |
this.update = update; | |
this.done = done; | |
} | |
Countdown.prototype.start = function () { | |
var self = this; | |
self.update(self.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Collection.extend({ | |
// #sadface | |
// collection.sadFilter().invoke('save') <- TypeError | |
sadFilter : function (m) { | |
return this.filter(function (m) { | |
return m.get('happiness') < 1 | |
}) | |
}, | |
// First option | |
// Wrap in underscore object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ scopeName = 'source.js'; | |
comment = 'JavaScript Syntax: version 2.0'; | |
fileTypes = ( 'js', 'htc', 'jsx' ); | |
foldingStartMarker = '^.*\bfunction\s*(\w+\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$'; | |
foldingStopMarker = '^\s*\}'; | |
patterns = ( | |
{ name = 'meta.class.js'; | |
comment = 'match stuff like: Sound.prototype = { É } when extending an object'; | |
match = '([a-zA-Z_?.$][\w?.$]*)\.(prototype)\s*(=)\s*'; | |
captures = { |
NewerOlder