Skip to content

Instantly share code, notes, and snippets.

@darul75
darul75 / helper_jpeglib.txt
Last active August 23, 2017 08:08
Max OS fatal error: 'jpeglib.h' file not found
Use Brew
> brew install libjpeg
find /usr | grep "libjpeg"
find /opt | grep "libjpeg"
Here what I have done
@darul75
darul75 / buttons.css
Last active August 29, 2015 13:56
CSS Play Pause Buttons
.play_border {
margin:5px;
border: 2px solid rgba(0,0,0,0.7);
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
width: 20px;
height: 20px;
-webkit-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.5);

This demonstrates raster-based reverse geocoding using canvas and D3.js. Geocoding is based on the color of the pixel at a given projected position. Note that the canvas is only shown here for the sake of explanation and debugging - this would in fact probably work faster if the canvas was not attached to the document at all.

The biggest remaining issue here is precision, which depends on:

  • the size of the canvas, and
  • the projection used.

Determining the optimum size based on the accuracy of your data is left as an exercise for the reader. Edge cases will also fail here, generally returning null - one option might be to stroke neighborhoods in a color, and then return an "uncertain" value for any non-grayscale pixel.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<canvas width=220 height=150></canvas>
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license