Skip to content

Instantly share code, notes, and snippets.

View bitner's full-sized avatar

David Bitner bitner

View GitHub Profile
@igrek8
igrek8 / query.sql
Created July 18, 2019 10:34
Postgres: Flatten JSON keys and keys paths
WITH RECURSIVE doc_key_and_value_recursive (
KEY,
value
) AS (
SELECT
t.key,
t.value
FROM
stories_collection AS item,
json_each(item.data) AS t
@jsanz
jsanz / README.md
Last active May 17, 2018 13:53
Geocode with Mapzen search and Google Spreadsheets

How to set up a quick geocoding system on google spreadsheets.

  1. Create a new spreadsheet
  2. Open the Scripts editor and paste the script attached
  3. Use on your spreadsheet this new formula
=searchMapzen(place_cell,mapzen_api_key)

@andrewxhill
andrewxhill / AXH_Vector_Sum.sql
Created January 23, 2012 22:01
Sum PostgreSQL arrays in place [1,2,3] + [2,3,4] = [3,5,7]
CREATE AGGREGATE vector_sum (
sfunc = AXH_Vector_Sum,
basetype = int[],
stype = int[],
initcond = '{0}'
);
DROP FUNCTION IF EXISTS AXH_Vector_Sum(int[], int[]);
CREATE OR REPLACE FUNCTION AXH_Vector_Sum(int[], int[])
RETURNS int[] AS $$
@mattbaker
mattbaker / README
Created December 22, 2011 06:02
SVG to PNG render with Node and D3.js
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
@adammiller
adammiller / douglasPeucker.js
Created February 14, 2011 16:54
Javascript implementation of the Douglas Peucker path simplification algorithm
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;