This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tar.gz browser storage import test | |
| // | |
| // RESULTS: | |
| // test 1: 233mb zipped, 22 files, 10MB per file, jpg | |
| // sw cache: 6s | |
| // idb: did not finish (froze browser) | |
| // | |
| // test 2: 55mb zipped, 600 files, ~100kb per file, map tiles | |
| // sw cache: 5s | |
| // idb: 49s |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // proxies 239.255.42.42:5004 from eth0 239.1.2.3:6666 wlan0 | |
| var dgram = require('dgram') | |
| var os = require('os') | |
| var socket = dgram.createSocket({ type: 'udp4', reuseAddr: true }) | |
| socket.bind(5004, function () { | |
| socket.addMembership('239.255.42.42', getIpForInterface('eth0')) | |
| socket.setMulticastTTL(255) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # enable multicast route so ffmpeg can resolve 2nd interface data | |
| sudo route add -net 239.0.0.0/8 dev eth0 | |
| # grab 1 frame of video as jpg | |
| run-every 60 ffmpeg -i udp://@239.255.42.42:5004 -f image2 -frames:v 1 -strftime 1 "%F-%H-%M-%S.jpg" | |
| # convert jpgs to movie | |
| rm -rf cropped | |
| mkdir cropped | |
| mogrify -path cropped/ -extract 1400x990+0+0 *.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var path = require('path') | |
| var fs = require('fs') | |
| var ytdl = require('youtube-dl') | |
| function playlist (url) { | |
| var video = ytdl(url) // add , ['--audio-format=mp3'] for mp3 only | |
| video.on('error', function error (err) { | |
| console.log('error 2:', err) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // $ node read.js nt.00.nin | |
| var fs = require('fs') | |
| var int53 = require('int53') | |
| f = process.argv[2] | |
| function read (fd, start, end, cb) { | |
| var len = end - start + 1 | |
| var buf = new Buffer(len) | |
| fs.read(fd, buf, 0, len, start, function (err) { | |
| cb(err, buf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ENV NSPAWN_BOOTSTRAP_IMAGE_SIZE=10GB | |
| FROM ubuntu:xenial | |
| # set unlimited bash history | |
| # nspawn needs resolv.conf to be set up for internet to work | |
| # password gets changed so we can login later | |
| RUN mkdir /usr/local/anacapa && \ | |
| cd /usr/local/anacapa && \ | |
| echo "export HISTFILESIZE=" >> .bashrc && \ | |
| echo "export HISTSIZE=" >> .bashrc && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $ = require('cheerio') | |
| var fs = require('fs') | |
| var walker = require('folder-walker') | |
| var transform = require('parallel-transform') | |
| var ndjson = require('ndjson') | |
| var walk = walker('./pageblobs') // generated by abstract-blob-store | |
| var scraper = transform(10, scrape) | |
| var out = ndjson.serialize() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var hyperdb = require('hyperdb') | |
| var hyperdiscovery = require('hyperdiscovery') | |
| var npmkey = '0f8a60595af5387d52b053af4a8a4aecd5d6d3799741c3993916798e71ea0730' | |
| var db = hyperdb('./npm.db', npmkey, {sparse: true, valueEncoding: 'json'}) | |
| db.on('ready', function () { | |
| var swarm = hyperdiscovery(db, {live: true}) | |
| db.once('remote-update', function () { | |
| db.get('/modules/aws.js', function (err, data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs') | |
| var request = require('request') | |
| var through = require('through2') | |
| var ndjson = require('ndjson') | |
| var once = require('once') | |
| var pump = require('pump') | |
| var concat = require('concat-stream') | |
| var parallel = require('parallel-transform') | |
| var hyperdb = require('hyperdb') | |
| var db = hyperdb('./npm.db', {valueEncoding: 'json'}) |