Skip to content

Instantly share code, notes, and snippets.

View hackergrrl's full-sized avatar
🌱

Kira hackergrrl

🌱
View GitHub Profile
@hackergrrl
hackergrrl / noffle.md
Last active August 19, 2017 03:35
noffle's linux setup
  • OS: NixOS (tough learning curve; recommend using Arch Linux)
  • Window Manager: i3
  • Menu Bar: i3bar
  • Wifi: my wifi- commands (depends on wpa_supplicant and dhcpcd)
  • Custom keyboard shortcuts: xbindkeys
  • Email: neomutt + getmail + msmtp
  • Terminal/Editor Font: Ubuntu Mono
  • Terminal Emulator: termite

dotfiles repo

foobar
#!/usr/bin/env bash
perf record -e cycles:u -g -- node --perf-basic-prof $1
perf script > perf-script.txt
cat perf-script.txt | flamegraph -t perf > perf-graph.svg
chromium perf-graph.svg
#!/usr/bin/env bash
perf record -e cycles:u -g -- node --perf-basic-prof $1
perf script > perf-script.txt
cat perf-script.txt | flamegraph -t perf > perf-graph.svg
chromium perf-graph.svg
#!/usr/bin/env bash
perf record -e cycles:u -g -- node --perf-basic-prof $1
perf script > perf-script.txt
cat perf-script.txt | flamegraph -t perf > perf-graph.svg
chromium perf-graph.svg
tape('unauthorized writer doing a put after replication', function (t) {
t.plan(1)
var a = create.one()
a.ready(function () {
var b = create.one(a.key)
b.ready(function () {
replicate(a, b, function () {
b.put('foo', 'bar', function (err) {
t.error(err)
})
var ram = require('random-access-memory')
var hyperdb = require('hyperdb')
var alice = hyperdb(ram, { valueEncoding: 'json' })
alice.put('foo/bar', 'baz', function () {
alice.put('foo/2', { some: 'json' }, function () {
var bob = hyperdb(ram, alice.key, { valueEncoding: 'json' })
bob.ready(function () {
alice.authorize(bob.local.key, function () {
var hyperdb = require('hyperdb')
var hindex = require('hyperdb-index-level')
var level = require('level')
var ram = require('random-access-memory')
var db = hyperdb(ram, { valueEncoding: 'json' })
var lvl = level('./index')
var idx = hindex(db, lvl, processor)
var alice = hyperdb(ram, { valueEncoding: 'json' })