Skip to content

Instantly share code, notes, and snippets.

View monking's full-sized avatar

Christopher Lovejoy monking

View GitHub Profile
// Finding a "start" point
> use proximity
switched to db proximity
> doc
{
"loc" : {
"type" : "LineString",
"coordinates" : [
[
@ryoppy
ryoppy / getQueryParams.js
Last active March 28, 2019 17:31
Parse query string. use Underscore.js.
/**
* Parse query string.
* ?a=b&c=d to {a: b, c: d}
* @param {String} (option) queryString
* @return {Object} query params
*/
getQueryParams: function(queryString) {
var query = (queryString || window.location.search).substring(1); // delete ?
if (!query) {
return false;
@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];