View memoize
// JavaScript
function memoize(fn) {
var memo = {}
return function(x) {
return memo[x] || (memo[x] = fn(x))
}
}
// Swift
func memoize<T: Hashable, U>( body: ((T)->U, T)->U ) -> (T)->U {
View gist:9403501
function fixDevTools() {
Element.prototype.enableStyleClass = function(){}
var oldToggle = DOMTokenList.prototype.toggle;
DOMTokenList.prototype.toggle = function(c) {
if ('offscreen' == c) return;
oldToggle.apply(this, arguments);
}
View SmoothScroll.js
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)