Skip to content
View digest.js
var hyperdrive = require('hyperdrive')
var memdb = require('memdb')
var drive = hyperdrive(memdb())
var archive = drive.createArchive({ live: true })
console.log(archive.key.toString('hex')) // stays the same
var digests = {}
commit0(function () {
commit1(function () {
View drive.js
var hyperdrive = require('hyperdrive')
var level = require('level')
var db = level('/tmp/test.db')
var drive = hyperdrive(db)
var cmd = process.argv[2]
var link = process.argv[3]
if (link) link = Buffer(link, 'hex')
View neocities_headers.txt
$ curl https://mafintosh.neocities.org -i
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 17 May 2016 09:56:06 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Cached: EXPIRED
<body>
View drive.js
var hyperdrive = require('hyperdrive')
var memdb = require('memdb')
var drive = hyperdrive(memdb())
var archive = drive.createArchive()
archive.createFileWriteStream('hello.txt').end('BEEP BOOP\n')
archive.finalize(function () {
archive.createFileReadStream('hello.txt').pipe(process.stdout)
})
View server.js
var router = require('routes')();
router.addRoute("GET /articles/:title?", function (req, res, params) {
// perform some IO...
res.end('article content goes here...\n');
});
router.addRoute("POST /articles/:title", function (req, res, params) {
// perform some IO...
res.setHeader('content-type', 'text/plain');
res.end('updated ' + params.title + '\n');
View hyperlog-kdb-index leveldb benchmark
5000 records written in 13.717 seconds
364 records per second
-----
replicated in 15.951 seconds
313 records per second
View before.c
float diric (float n, float x);
vec3 hsl2rgb (float h, float s, float l);
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
float x = fragCoord.x - 400.0;
float y = fragCoord.y - 800.0;
float t = iGlobalTime*2.0;
float z = 200.0 - (1.0 + sin(t/20.0)) / 20.0 * 40.0;
float z0 = 350.0 - (1.0 + sin(t/20.0)) / 2.0 * 40.0;
View glitch.js
var regl = require('regl')()
var mat4 = require('gl-mat4')
var cubeMesh = require('cube-mesh')
var mesh = cubeMesh(1)
var cube = regl({
frag: `
precision mediump float;
varying vec3 pos;
void main () {
View cube.js
var regl = require('regl')()
var mat4 = require('gl-mat4')
var cubeMesh = require('cube-mesh')
var mesh = cubeMesh(1)
var cubes0 = []
for (var i = 0; i < 80; i++) cubes0.push(createCube())
var cubes1 = []
for (var i = 0; i < 80; i++) cubes1.push(createCube())
View cube.js
var regl = require('regl')()
var graycode = require('gray-code')
var mat4 = require('gl-mat4')
regl.clear({
color: [1,0.5,0,1]
})
var cube = regl({
frag: `
void main () {
Something went wrong with that request. Please try again.