Skip to content

Instantly share code, notes, and snippets.

View w8r's full-sized avatar
💭
learning

Alexander Milevski w8r

💭
learning
View GitHub Profile
@w8r
w8r / .block
Created February 23, 2017 10:01 — forked from enjalot/.block
Rainbow Pack (adapted for d3.unconf badge)
license: gpl-3.0
height: 960
@w8r
w8r / L.SvgScaleOverlay.js
Last active January 11, 2016 15:57 — forked from Sumbera/L.SvgScaleOverlay.js
SVG scaled overlay in Leaflet
/*
Stanislav Sumbera, August , 2015
- scaled SVG draw prototype on top of Leaflet 1.0 beta
- note it uses L.map patch to get it working right
- SVG data are not modified, only scaled and optionaly radius/stroke width etc. can be specified on onScaleChange callback
- very experimental
*/
//-- Patch to get leaflet properly zoomed
@w8r
w8r / README.md
Last active August 29, 2015 14:23 — forked from mbostock/.block

Click and drag above to paint red hexagons. A black outline will appear around contiguous clusters of red hexagons. This outline is constructed using topojson.mesh, part of the TopoJSON client API. A filter is specified so that the mesh only contains boundaries that separate filled hexagons from empty hexagons.

The hexagon grid itself is represented as TopoJSON, but is constructed on-the-fly in the browser. Since TopoJSON requires quantized coordinates, the hexagon grid is represented as integers, with each hexagon of dimensions 3×2. Then a custom projection is used to transform these irregular integer hexagons to normal hexagons of the desired size.

/**
*
* Hooking up Watchify with Google's Web Starter Kit
*
* The primary use cases for Browserify/Watchify are:
* - Node.js-style `require`s on the client-side
* - Use of npm modules on the client-side
* - No more new <script> tags for each new script/module
*
* 1. npm install --save-dev vinyl-source-stream browserify watchify gulp-notify
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@w8r
w8r / hosts
Last active August 29, 2015 14:08 — forked from dlo/hosts
255.255.255.255 006.free-counter.co.uk
255.255.255.255 006.freecounters.co.uk
255.255.255.255 06272002-dbase.hitcountz.net # Web bugs in spam
255.255.255.255 09killspyware.com
255.255.255.255 0stats.com
255.255.255.255 1.adbrite.com
255.255.255.255 1.httpads.com
255.255.255.255 1.primaryads.com
255.255.255.255 102.112.2o7.net
255.255.255.255 102.122.2o7.net