Skip to content

Instantly share code, notes, and snippets.

View ahdinosaur's full-sized avatar
☀️
abundant

Mikey ahdinosaur

☀️
abundant
View GitHub Profile
| 14:17:10 <dinosaur> . ,o88888 |
| 14:17:10 <dinosaur> . ,o8888888' |
| 14:17:10 <dinosaur> . ,.::.::o:ooooOoOoO. ,oO8O8Pd888'" |
| 14:17:10 <dinosaur> . , ..:.::o:ooOoOOOO8OOOOo.FdO8O8" |
| 14:17:10 <dinosaur> . , . ..:.::o:ooOoOOOO8OOOOCOCO
/home/dinosaur/.nvm/versions/node/v8.11.1/lib/node_modules/@noffle/cabal/neat-screen.js:164
if (key === self.state.user.key) self.state.user = user
^
TypeError: Cannot read property 'key' of null
at /home/dinosaur/.nvm/versions/node/v8.11.1/lib/node_modules/@noffle/cabal/neat-screen.js:164:41
at /home/dinosaur/.nvm/versions/node/v8.11.1/lib/node_modules/@noffle/cabal/node_modules/levelup/lib/levelup.js:211:7
at Immediate.callNext [as _onImmediate] (/home/dinosaur/.nvm/versions/node/v8.11.1/lib/node_modules/@noffle/cabal/node_modules/memdown/memdown.js:173:5)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
const toConstantCase = pipe(
map(toUpper),
join('_')
)
function pipe (...fns) {
return (value) => {
return fns.reduce((sofar, nextFn) {
return nextFn(sofar)
}, value)
@ahdinosaur
ahdinosaur / index.js
Last active October 7, 2016 04:00
requirebin sketch
var html = require('yo-yo')
var node = render()
document.body.appendChild(node)
function render (content) {
return html`
<div>
<textarea
placeholder="type here!"
@ahdinosaur
ahdinosaur / index.js
Last active September 12, 2016 09:15
requirebin sketch
var pull = require('pull-stream')
var paramap = require('pull-paramap')
var async = require('pull-async')
var xhr = require('xhr')
var urls = [
'https://raw.githubusercontent.com/terinjokes/gulp-license/master/licenses/agpl3.txt',
'https://raw.githubusercontent.com/terinjokes/gulp-license/master/licenses/apache.txt',
'https://raw.githubusercontent.com/terinjokes/gulp-license/master/licenses/mit.txt'
]
@ahdinosaur
ahdinosaur / index.js
Created September 12, 2016 09:02
requirebin sketch
var pull = require('pull-stream')
var paramap = require('pull-paramap')
pull(
pull.values([1, 2, 3, 4, 5]),
paramap(function (amount, cb) {
pull(
pull.infinite(Math.random),
pull.take(amount),
pull.collect(cb)
@ahdinosaur
ahdinosaur / choo.txt
Created July 21, 2016 01:24
chat logs from freenode #choo
20:04 < ahdinosaur> if anyone is interested in a choo-like API where it's pull-streams all the way down, i made some helpers for `inu`: https://github.com/ahdinosaur/inux
20:04 < yoshuawuyts> ahdinosaur: I'm curious: how big is inu?
20:04 < yoshuawuyts> probably smaller than choo I'd think
20:05 < yoshuawuyts> well, inux would be more fair to compare I reckon but still
20:05 < ahdinosaur> one sec, i'll discify
20:05 < yoshuawuyts> ahdinosaur: I'm using this for choo https://github.com/yoshuawuyts/choo/blob/master/scripts/instrument#L24-L35
20:06 < yoshuawuyts> gzip size tends to translate slightly better I find
20:06 < ronnross> So curious how one would use something like https://codemirror.net/ in Choo.
20:07 < ronnross> Would you work directly with the dome of use subscriptions to handle working with it.
20:07 < ronnross> Might sound like a crazy question, but when I implemented it in Elm I had to use ports and subscriptions.
@ahdinosaur
ahdinosaur / inu.html
Created July 21, 2016 00:24
discify of inu and inux
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400|Source+Code+Pro:300,500' rel='stylesheet' type='text/css'>
<style>body,html{font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:100;position:relative;background:#6A4A3C;margin:0;padding:0;color:#fff;-webkit-animation:background 2s;animation:background 2s}body{overflow-x:hidden;width:100%}.content{-webkit-animation:content 4s;animation:content 4s}.content img{display:none}h1,h2,h3,h4,h5,h6{font-weight:200}h1{font-weight:200;font-size:2.82em;text-align:center;margin:0 auto 1em;width:600px;padding-bottom:.5em;letter-spacing:.075em;border-bottom:1px dotted rgba(255,255,255,.75);padding-top:.775em}h1,h2{box-shadow:0 11px 10px -10px rgba(0,0,0,.25)}h2{border-bottom:1px dotted rgba(255,255,255,.75);padding-bottom:.25em;padding-top:1em}.chart{margin:0 auto}.chart,.modes,.palette-wrap{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:non
# Platform
ok 1 (unnamed assert)
Node.js 6.2.1 on Linux 64-bit
# add and remove
dripEmitter x 15,065,933 ops/sec ±4.48% (14 runs sampled)
MiniSignals x 7,834,762 ops/sec ±4.84% (14 runs sampled)
ReactiveProperty x 2,849,449 ops/sec ±3.59% (15 runs sampled)
EventDispatcher x 2,661,521 ops/sec ±3.50% (16 runs sampled)
EventEmitter x 1,857,740 ops/sec ±10.11% (13 runs sampled)

Tests

  • ✔ Platform [pass: 1, fail: 0, duration: 1ms]
  • ✔ add and remove [pass: 20, fail: 0, duration: 1ms]
  • ✔ emit one array [pass: 48, fail: 0, duration: 4ms]
  • ✔ emit many values - two listeners [pass: 30, fail: 0, duration: 3ms]
  • ✔ emit one object - one listener [pass: 40, fail: 0, duration: 2ms]
  • ✔ emit one object - two listeners [pass: 54, fail: 0, duration: 1ms]
  • ✔ emit one value - bound function [pass: 51, fail: 0, duration: 1ms]
  • ✔ emit one value - many listeners [pass: 36, fail: 0, duration: 3ms]