stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
This file contains 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
#!/usr/bin/env ruby | |
# A quick and dirty implementation of an HTTP proxy server in Ruby | |
# because I did not want to install anything. | |
# | |
# Copyright (C) 2009 Torsten Becker <[email protected]> | |
require 'socket' | |
require 'uri' | |
This file contains 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
* Quit Sublime Text 2 (so you don’t accidentally change any settings) | |
* In your Dropbox folder (usually at ~/Dropbox/), add a folder called Sublime Text 2 | |
* Open the folder with your ST2 settings (should be ~/Library/Application Support/Sublime Text 2/) | |
* Copy the following 3 folders into ~/Dropbox/Sublime Text 2/: Installed Packages, Packages, and Pristine Packages | |
* Rename the original 3 folders in ~/Library/Application Support/Sublime Text 2/ to something like Installed Packages-20110119, |
This file contains 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
/** | |
* SELECT2 | |
* | |
* Renders Select2 - jQuery based replacement for select boxes | |
* | |
* Requires an 'options.values' value on the schema. | |
* Can be an array of options, a function that calls back with the array of options, a string of HTML | |
* or a Backbone collection. If a collection, the models must implement a toString() method | |
*/ | |
Backbone.Form.editors.Select2 = Backbone.Form.editors.Base.extend({ |
This file contains 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
// directly uploads to S3 | |
// See http://philfreo.com/blog/how-to-allow-direct-file-uploads-from-javascript-to-amazon-s3-signed-by-python/ | |
// See https://github.com/elasticsales/s3upload-coffee-javascript | |
editors.Filepicker = editors.Text.extend({ | |
tagName: 'div', | |
events: { | |
'change input[type=file]': 'uploadFile', |
This file contains 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
// like 'Select' editor, but will always return a boolean (true or false) | |
editors.BooleanSelect = editors.Select.extend({ | |
initialize: function(options) { | |
options.schema.options = [ | |
{ val: '1', label: 'Yes' }, | |
{ val: '', label: 'No' } | |
]; | |
editors.Select.prototype.initialize.call(this, options); | |
}, | |
getValue: function() { |
This file contains 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
<!-- Raven.js Config --> | |
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
// Ignore list based off: https://gist.github.com/1878283 | |
var ravenOptions = { | |
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
// See: https://github.com/getsentry/raven-js/issues/73 | |
ignoreErrors: [ | |
// Random plugins/extensions | |
'top.GLOBALS', |
This file contains 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(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone"); |
This file contains 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
formEvent: function (event) { | |
console.log(event); // "Not defined!" -- Firefox | |
eventType = event.target.type; | |
switch (eventType) { | |
case "checkbox": | |
classArray = event.target.classList; | |
key = classArray[0]; | |
value = classArray[1]; |
This file contains 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
var Vertebrate = {}; | |
Vertebrate.Model = Backbone.Model.extend(); | |
Vertebrate.Collection = Backbone.Collection.extend({ | |
model: Vertebrate.Model | |
}); | |
// Source: http://en.wikipedia.org/wiki/Vertebrates | |
var vertebrates = new Vertebrate.Collection([ |
NewerOlder