Skip to content

Instantly share code, notes, and snippets.

View edwinwebb's full-sized avatar

Edwin Webb edwinwebb

View GitHub Profile
@edwinwebb
edwinwebb / SanFrancisco.Neighborhoods.json
Created August 28, 2019 16:20 — forked from cdolek/SanFrancisco.Neighborhoods.json
San Francisco Neighborhoods GeoJson with Zipcodes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edwinwebb
edwinwebb / bitcolor.js
Created September 5, 2016 11:54 — forked from lrvick/bitcolor.js
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@edwinwebb
edwinwebb / equivalent.js
Created July 30, 2012 22:37 — forked from tj/equivalent.js
example of backbone-style routing with Express
app.get('/help', function(req, res){
res.send('some help');
});
app.get('/search/:query/p:page', function(req, res){
var query = req.params.query
, page = req.params.page;
res.send('search "' + query + '", page ' + (page || 1));
});