Skip to content

Instantly share code, notes, and snippets.

@hellosmithy
hellosmithy / unload.js
Created July 1, 2014 13:05
Mobile Safari image unload
// Credit to: http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/
var img = document.getElementById('previous');
img.parentNode.removeChild(img);
img.src = 'data:image/gif;base64,' +
'R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
window.timeout(function() {
img = null;
}, 60000);
@hellosmithy
hellosmithy / serialize_data_override.js
Created July 28, 2014 14:26
Marionette `serializeData` override
serializeData: function() {
// call the original
var data = Marionette.View.prototype.serializeData.apply(this, arguments);
// add new data
data.whatever = myChannel.request('whatever');
return data;
}
@hellosmithy
hellosmithy / rebase
Created June 15, 2015 13:47
git rebase
$ git rebase -i HEAD~4
pick 01d1124 Adding license
pick 6340aaa Moving license into its own file
pick ebfd367 Jekyll has become self-aware.
pick 30e0ccb Changed the tagline in the binary, too.
# Rebase 60709da..30e0ccb onto 60709da
#
# Commands: