The Voronoi tessellation shows the closest point on the plane for a given set of points. This example updates the Voronoi diagram in response to mouse interaction! Colors by Cynthia Brewer; algorithm by Steven Fortune; implementation based on work by Nicolas Garcia Belmonte; interaction inspired by Raymond Hill.
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
fun! <SID>StripTrailingWhitespaces() | |
let l = line(".") | |
let c = col(".") | |
%s/\s\+$//e | |
call cursor(l, c) | |
endfun | |
autocmd FileType c,cpp,java,php,ruby,python autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces() |
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
kill -9 `lsof -i tcp:5858 | awk '{print $2}' | tail -1` |
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 Nightmare = require('nightmare'); | |
var async = require ('async'); | |
var urls = ['https://segment.com/', 'http://www.nytimes.com/', 'http://www.gnu.org/']; | |
function test(url, cb) { | |
console.log('test: ' + url); | |
var nightmare = new Nightmare(); | |
nightmare | |
.goto(url) | |
.evaluate(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
var Nightmare = require('nightmare'); | |
var urls = ['http://www.nytimes.com/', 'http://www.gnu.org/']; | |
function test() { | |
var nightmare1 = new Nightmare(); | |
var nightmare2 = new Nightmare(); | |
nightmare1 | |
.goto(urls[0]) | |
.evaluate(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
redis-cli KEYS 'icc*' | xargs -d '\n' redis-cli DEL |
Mouseover to see flights originating at the specified airport. The cool thing about this technique is that the interaction requires zero JavaScript — it’s all done in CSS using the :hover state to toggle visibility of an airport’s associated outgoing flight routes.
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
d3.json('geojsoncounties.json', function (err, counties) { | |
var countyLayer = L.geoJson(counties, { | |
weight: 5, | |
color: '#000', | |
dashArray: '', | |
fillOpacity: 0.7 | |
}); | |
map.addLayer(countyLayer); | |
}); |