This file contains 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
const sqlite = require('sqlite'); | |
const msgpack = require('msgpack-lite'); | |
const fs = require('fs'); | |
const pathlib = require('path'); | |
const zoneToFilename = (zone) => zone.replace(/[^\p{L}\p{N}_\-]+/gu, '') || '_'; | |
const separator = '\x1f'; | |
const mangle = (key) => { | |
if (typeof key === 'string') return key + separator; | |
else return key.join(separator) + separator; | |
}; |
This file contains 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
let msgpackLite = require('msgpack-lite'); | |
let borc = require('borc'); | |
let _ = require('lodash'); | |
let { performance } = require('perf_hooks') | |
let arrays = _.times(100, (n) => { | |
return _.times(n, i => _.random(10000, 99999, false)) | |
}); | |
let encodedBORC = arrays.map(array => borc.encode(array)); |
This file contains 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
13:05 < fujisan> elliottcable: you have spotify | |
13:06 < fujisan> could you check for me, if this song is on spotify | |
13:06 < fujisan> really irks me that i can't find it on spotify :( | |
13:06 < fujisan> http://vimeo.com/8392741 | |
13:07 < fujisan> such a nice tune :o | |
13:07 < fujisan> i know khaase | |
13:07 < fujisan> that's why i asked elliottcable | |
13:07 < fujisan> :) | |
13:07 < fujisan> since he is in the USA and i am in the Netherlands | |
13:07 < fujisan> licensing differs per country ye :) |
This file contains 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
(function () { | |
var array1, array2, array3, array4, gen, y, x; | |
array1 = [50, 30, 70, 20]; | |
var obj = { | |
idx: 0, | |
next: function() { | |
if (obj.idx >= array1.length) { | |
return { done: true }; | |
} |
This file contains 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
_ = require 'lodash' | |
{Tokenizer} = require './tokenize' | |
last = _.last | |
# There's two varieties of data structures: 'vals' and 'val' | |
# 'vals' is a branch node that contains many direct children | |
# 'val' is a leaf node that has no direct children | |
makeVals = (kind, vals) -> { kind: kind, vals: vals } |
This file contains 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
a-̧̀ŝ̖ü͈p̩̥̿̾ề̫̻ŕ͈̪́i̡̩̔̀ó̪̙̅r̛͕̭̈́-̣̮̯̼̤̱̗͗̆̍̿͛̕̕̚͘͜͜c͚̼͉̠͚̘͚̍͗̐̈́̾̑͜͜͠͝͠u̫͙̤̥͖̠̻̲͓͊̌̓̂̎̉̉̓͝ĺ̛̠̘͉̠̩̬̝̰̣̔̆̇̓̒̑̉t̜̼͍͉̜̙̤̫͊̅̎́͂͛̄̑͝ͅ- |
This file contains 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
(function () { | |
var array1, array2, array3, array4, gen, iterator, x; | |
array1 = [50, 30, 70, 20]; | |
gen = function*() { | |
return (yield* array1); | |
}; | |
array2 = []; | |
array3 = []; | |
array4 = []; | |
iterator = gen(); |
This file contains 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
/* | |
on my machine: | |
es3 50000095000000 1085 ms | |
es5 50000095000000 11037 ms | |
es6 50000095000000 910 ms | |
es3 50000095000000 1100 ms | |
es5 50000095000000 11640 ms | |
es6 50000095000000 876 ms | |
*/ |
This file contains 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
typedef id (^Tuple)(int i); | |
#define MUT_INTERNAL_VAARG_COUNT(...) (sizeof((__strong id[]){__VA_ARGS__}) / sizeof(__strong id)) | |
#define TUPLE(...) ({ \ | |
const unsigned mut_n = MUT_INTERNAL_VAARG_COUNT(__VA_ARGS__); \ | |
struct { __strong id mut_objs[mut_n]; } mut_innards = {{ __VA_ARGS__ }}; \ | |
^ id (int mut_i) { \ | |
return (mut_i < 0 || mut_i >= mut_n) ? nil : mut_innards.mut_objs[mut_i]; \ | |
}; \ |
This file contains 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
~~ bool ~~ | |
bool#type(object) -> the object's type | |
bool#str(object='') -> str | |
bool#from_bytes(bytes, byteorder, *, signed=False) -> int | |
bool#to_bytes(length, byteorder, *, signed=False) -> bytes | |
~~ bytearray ~~ | |
bytearray#type(object) -> the object's type | |
bytearray#str(object='') -> str | |
bytearray#center(width[, fillchar]) -> copy of B | |
bytearray#count(sub[, start[, end]]) -> int |
NewerOlder