Skip to content

Instantly share code, notes, and snippets.

View whitelynx's full-sized avatar
😸

David H. Bronke whitelynx

😸
View GitHub Profile
@whitelynx
whitelynx / .block
Last active August 30, 2016 14:23 — forked from mbostock/.block
Horizon Chart
license: gpl-3.0
@whitelynx
whitelynx / cVimrc.vim
Last active June 15, 2019 03:24
cVim configuration
set defaultnewtabpage
let barposition = "bottom"
let completionengines = ["duckduckgo", "wikipedia", "google", "google-images", "youtube"]
let defaultengine = "duckduckgo"
let blacklists = ["https://mail.google.com/*", "https://inbox.google.com/*", "http*://trello.com/*", "http*://checkvist.com/*", "http*://gingkoapp.com/*"]
"let hintcharacters = "ueoaihtnsdkjq;xmwvzbp.,'ygcrlf"
"let hintcharacters = "ueoaikjq;xp.,'yhtnsdmwvzbgcrlf"
"let hintcharacters = "ueoakjq;p.e,'ixyhtnsmwvzgcrldbf"
@whitelynx
whitelynx / _.md
Last active June 9, 2016 22:34
query-plan-sankey
@whitelynx
whitelynx / _.md
Created June 7, 2016 22:18
sankey-test-1
// ---------------------------------------------------------------------------------------------------------------------
// PromiseProxy - A proxy object that wraps a promise, and exposes `pending`, `result` and `error` properties. This is
// most useful when setting results of promises on the scope directly, so you can work with them in your templates.
//
// @module promise-proxy.js
// ---------------------------------------------------------------------------------------------------------------------
function PromiseProxyFactory(promise)
{
var proxy = {
@whitelynx
whitelynx / header-parse.js
Created May 29, 2014 22:33
Parse (mostly) RFC822-compliant headers.
//---------------------------------------------------------------------------------------------------------------------
// Parse (mostly) RFC822-compliant headers.
//
// This will parse header blocks that conform to [RFC822 Section 3][], as well as a few variations of that standard.
// One major deviation is that this library treats '\r\n' and '\n' as the same, so headers separated by either will be
// parsed.
//
// [RFC822 Section 3]: https://tools.ietf.org/html/rfc822#section-3
//
// @module header-parse
@whitelynx
whitelynx / query-func-classification.js
Last active August 29, 2015 14:01
OmegaDB examples/comments
//// Functions that return... ////
// ...queries: //
row.join('government.dim_state', {state_code: row.field('loc_state')})
// ...selectors: //
row.field('loc_state')
row.join('government.dim_state', {state_code: row.field('loc_state')}).field('state_abbrev')
// ...filters: //
@whitelynx
whitelynx / test-gdal-vrt-output.py
Created February 6, 2014 21:57
A simple (slightly broken) implementation of writing a VRT file from Python, using GDAL.
#!/usr/bin/env python2
"""A simple (slightly broken) implementation of writing a VRT file from Python, using GDAL.
Adapted from sample code at: http://gis.stackexchange.com/questions/44003/python-equivalent-of-gdalbuildvrt#answer-44048
"""
## Options ##
x_size, y_size = 512, 512
source_path = 'test.tif'
source_band = 1
@whitelynx
whitelynx / test-hstore.js
Created June 21, 2013 17:26
Example of possible usage for hstore type conversion.
var util = require('util');
var _ = require('lodash');
var pg = require('pg');
/**
* Convert a JavaScript object to the PostgreSQL `hstore` format.
*
* @param object e.g. {a:1, b:2, c:3}
* @return e.g. 'a=>1,b=>2,c=>3'
@whitelynx
whitelynx / postgres-equals-any.js
Created May 31, 2013 16:31
Full example of filtering PostgreSQL queries in node-postgres using `= ANY(...)`
#!/usr/bin/env node
var util = require('util');
var async = require('async');
var pg = require('pg');
//---------------------------------------------------------------------------------------------------------------------
var connection = {