I hereby claim:
- I am justanotherdot on github.
- I am justanotherdot (https://keybase.io/justanotherdot) on keybase.
- I have a public key ASBlyFzHcoI9TxG3TnYwiEAB0Ikp3GHwBN_JLNr1SRpBHQo
To claim this, I am signing this object:
| // Our ideal type. | |
| interface Foo { | |
| readonly a: number; | |
| } | |
| type Section = Foo[]; | |
| type Group = Section[]; | |
| // Now we start messing with TS. | |
| // `extends` and `optional?` allow us to add almost |
| // Trigger a timer after an event but do not throw away the initial event. | |
| Observable.of(true) | |
| .repeat() | |
| .switchMap(val => Observable.timer(5000).mapTo(!val).startWith(val)); | |
| # Pick a random word from `/usr/share/dict/words'. | |
| cat /usr/share/dict/words | tail -n $(( RANDOM % `wc -l /usr/share/dict/words | cut -f1 -d' '` )) | head -1 | |
I hereby claim:
To claim this, I am signing this object:
| import requests | |
| import json | |
| import time | |
| API_KEY = "" | |
| API_TOKEN = "" | |
| table_id = "" | |
| url = "https://api.trello.com/1/boards/{}/cards/closed/?key={}&token={}".format(table_id, API_KEY, API_TOKEN) |
| #!/usr/bin/env sh | |
| set -eu | |
| version() { | |
| echo "git-wash v0.1.0" | |
| echo | |
| } | |
| usage() { | |
| echo "usage: git wash <branch>" |
| defmodule UUID4 do | |
| @moduledoc """ | |
| Rough sketch of a uuid4 implementation | |
| """ | |
| @doc false | |
| def uuid4 do | |
| <<u0::48, _::4, u1::12, _::2, u2::62>> = :crypto.strong_rand_bytes(16) | |
| <<u0::48, 4::4, u1::12, 2::2, u2::62>> | |
| end |
| // Both TypeScript and Flow can check for this but rely on a hack. | |
| // There is a reliance for a clause where an illegal assignment | |
| // would take place to a value of type `never` or `empty` | |
| // (ts and flow respectively) | |
| type Maybe<T> = { tag: 'Just', payload: T } | { tag: 'Nothing' }; | |
| function pure<T>(x: T): Maybe<T> { | |
| return { tag: 'Just', payload: x }; | |
| } |
| const talk = (optText) => { | |
| let text = optText || Array.from(document.querySelectorAll('p')).map(p => p.outerText).join(' '); | |
| let t2s = new SpeechSynthesisUtterance(text); | |
| let voices = window.speechSynthesis.getVoices(); | |
| t2s.voice = voices.filter(v => v.name === 'Samantha')[0]; // Samantha is the standard US voice and lives at index 32 when I call this for my browser. Your locale may change this ordering. | |
| t2s.onend = function(e) { console.log('Read in ' + e.elapsedTime + ' seconds'); }; | |
| window.speechSynthesis.speak(t2s); | |
| }; | |
| // You can stop the output by calling... |