Skip to content

Instantly share code, notes, and snippets.

@gwintrob
gwintrob / example.js
Created December 3, 2015 06:03
geojson
d3.json('geojsoncounties.json', function (err, counties) {
var countyLayer = L.geoJson(counties, {
weight: 5,
color: '#000',
dashArray: '',
fillOpacity: 0.7
});
map.addLayer(countyLayer);
});
@gwintrob
gwintrob / README.md
Last active November 26, 2015 22:28 — forked from mbostock/.block
Voronoi Arc Map

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.

@gwintrob
gwintrob / README.md
Created November 23, 2015 20:08 — forked from mbostock/.block
Voronoi Tessellation
@gwintrob
gwintrob / gist:6abc086b2425f3a8d5c8
Created December 4, 2014 20:03
Delete redis keys with unmatched single quotes
redis-cli KEYS 'icc*' | xargs -d '\n' redis-cli DEL
@gwintrob
gwintrob / index.js
Last active July 21, 2016 18:58
Multiple Nightmare Example
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 () {
@gwintrob
gwintrob / index.js
Created November 5, 2014 20:14
Nightmare Async Example
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 () {
kill -9 `lsof -i tcp:5858 | awk '{print $2}' | tail -1`
@gwintrob
gwintrob / StripTrailingWhitespaces
Last active December 10, 2015 13:18
Strip trailing whitespace in Vim
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()