Skip to content

Instantly share code, notes, and snippets.

View jakeburden's full-sized avatar
🎯
Focusing

Jake Burden jakeburden

🎯
Focusing
View GitHub Profile
@jakeburden
jakeburden / streamdata-blockchain.js
Created January 12, 2018 03:30
streamdata-blockchain
var streamdata = require('streamdata.io-events')
var hyperdb = require('hyperdb')
var ram = require('random-access-memory')
var diffs = require('diffs-to-string')
var db = hyperdb(function (filename) {
return ram()
})
var SSE = streamdata('http://stockmarket.streamdata.io/v2/prices',
scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/
/* JSONPath 0.8.5 - XPath for JSON
*
* Copyright (c) 2007 Stefan Goessner (goessner.net)
* Licensed under the MIT (MIT-LICENSE.txt) licence.
*
* Proposal of Chris Zyp goes into version 0.9.x
* Issue 7 resolved
*/
function jsonPath(obj, expr, arg) {
var P = {
@jakeburden
jakeburden / gist:ac2dd9aee7bac6e41b05d50d9db31324
Last active September 28, 2017 02:05
dnsmasq config location
/usr/local/etc/dnsmasq.conf
async function dateStream () {
var data
var read = dates()
while (data = await read()) {
console.log(data)
}
}
function dates () {
@jakeburden
jakeburden / scaperzip.js
Created August 29, 2017 00:26
scraping some stuff
var get = require('simple-get')
var parallel = require('run-parallel')
var trumpet = require('trumpet')
var urls = {
domains: 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt',
animals: 'https://en.wikipedia.org/wiki/List_of_animal_names'
}
var getUrls = []
@jakeburden
jakeburden / from2-dom.js
Created April 2, 2017 21:00
module idea sketch
var through = require('throug2')
var fromDom = require('from2-dom')
var concat = require('concat-stream')
fromDom(document.querySelectorAll('p'))
.pipe(through())
.pipe(concat(function (buf) {
console.log(buf)
})
@jakeburden
jakeburden / simple-transform-stream.js
Last active January 3, 2017 06:43
simple transform stream
var stream = require('stream')
var inherits = require('inherits')
inherits(Upper, stream.Transform)
function Upper () {
stream.Transform.call(this)
}
Upper.prototype._transform = function (data, enc, cb) {
somejunk <! />
nope
yes yup yeah
ok ok ok!