var data = keyMirror({
ONE: null,
TWO: null,
OTHER: keyMirror({
STUFF: null
}, "OTHER")
});
🏳️🌈
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
var timeoutId = 0; | |
var timeouts = {}; | |
var worker = new Worker("/static/timeout-worker.js"); | |
worker.addEventListener("message", function(evt) { | |
var data = evt.data, | |
id = data.id, | |
fn = timeouts[id].fn, | |
args = timeouts[id].args; |
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
ChangingModelPropMixin = function(propName, handlerName) { | |
return { | |
componentWillReceiveProps: function(nextProps) { | |
if (nextProps[propName] && nextProps[propName] !== this.props[propName]) { | |
this.props[propName].removeListener("change", this[handlerName]); | |
nextProps[propName].on("change", this[handlerName]); | |
} | |
}, | |
componentDidMount: function () { |
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() { | |
Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')).forEach(function(node) { | |
node.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; | |
}) | |
}, 500) |
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
angular.module('app.common.directives.html-editor', []) | |
.directive('htmlEditor', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
'html': '=' | |
}, | |
link: function (scope, element, attrs, ctrl) { | |
// this is a browserify bundle where my react components live |
In response to Oliver O’Brien’s analysis of Snowden Route Maps. D3’s geographic projection system assumes great-arc segments between points, so it’s easy to build route maps like this.
A simple example drawing a great arc as a LineString. The projection is rotated to avoid interrupting the arc. See also an earlier example with multiple great arcs.