Skip to content

Instantly share code, notes, and snippets.

View DamonOehlman's full-sized avatar

Damon Oehlman DamonOehlman

View GitHub Profile
@wolfeidau
wolfeidau / pi-build-deb.sh
Last active August 18, 2021 07:05
Build nodejs from source and assemble a deb package which installs on the Raspberry pi
#!/bin/bash
set -e
set -o errtrace
node_version="0.10.20"
source_bundle="http://nodejs.org/dist/v${node_version}/node-v${node_version}.tar.gz"
# store the location of the base working area.
@max-mapper
max-mapper / index.js
Last active May 9, 2021 02:20
fast loading of a large dataset into leveldb
// data comes from here http://stat-computing.org/dataexpo/2009/the-data.html
// download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv
// 1994.csv should be ~5.2 million lines and 500MB
// importing all rows into leveldb took ~50 seconds on my machine
// there are two main techniques at work here:
// 1: never create JS objects, leave the data as binary the entire time (binary-split does this)
// 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this)
var level = require('level')
@dominictarr
dominictarr / CYPHERLINK.md
Last active March 15, 2024 22:40
Cypherlinks
@addyosmani
addyosmani / headless.md
Last active July 18, 2023 18:47
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@sterlingwes
sterlingwes / webplatform.js
Created March 6, 2013 05:30
BlackBerry WebWorks Native Javascript Wrapper exposed at platform:///webplatform.js by webviews
(function () {
/*
Copyright 2012 Research In Motion Limited.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@AndreasMadsen
AndreasMadsen / WhatIHaveDone.md
Last active February 13, 2022 16:15
Playing with smartos
@max-mapper
max-mapper / index.js
Created August 11, 2012 00:14
geo queries on leveldb (geohash) (not really usable)
var plumbdb = require('plumbdb')
var shp2json = require('shp2json')
var tako = require('tako')
var geohash = require('geohash').GeoHash // my fork (not on npm): https://github.com/maxogden/geohash-js
var JSONStream = require('JSONStream')
var async = require('async')
var gju = require('geostuff')
var t = tako()
@max-mapper
max-mapper / index.js
Created July 7, 2012 00:04
geohash based spatial index on leveldb
var plumbdb = require('plumbdb')
var shp2json = require('shp2json')
var tako = require('tako')
var geohash = require('geohash').GeoHash
var JSONStream = require('JSONStream')
var async = require('async')
var gju = require('geostuff')
var t = tako()
@mobz
mobz / DOMj.mdown
Created May 28, 2012 05:53
DOM transport via JSON (DOMj)

DOM transport via JSON (DOMj)

move to repo mobz/domj