Skip to content

Instantly share code, notes, and snippets.

View nissoh's full-sized avatar
🎯
Focusing

itburnz nissoh

🎯
Focusing
  • 2501
  • Sea of information
View GitHub Profile
@nissoh
nissoh / most-thread.ts
Created March 7, 2017 10:51
most inline threading
import { of, Stream, Scheduler, Sink, Source } from 'most'
import { curry2, CurriedFunction2 } from '@most/prelude'
class ThreadSource<T, R> implements Source<R> {
constructor (private fn: (a1: T) => void, private arg: T) {
}
run (sink: Sink<R>, scheduler: Scheduler) {
const fnContextStr = `(${this.fn.toString()})(${JSON.stringify(this.arg)})`
@nissoh
nissoh / nanowat.ch
Created March 4, 2018 15:16
nano watch deposit alarm https://nanowat.ch/account/xrb_3jwrszth46rk1mu7rmb4rhm54us8yg1gw3ipodftqtikf5yqdyr7471nsg1k - run this script in your developer tools
const compose = (f, g) => (x) => f(g(x))
const getAmountAndSliceMxrbStr = ev => ev.querySelector('.amount').textContent.slice(0, -5).split(',').join('')
const play = (url) => new Audio(url).play()
const soundChaChing = () => play('http://soundbible.com/mp3/Cha_Ching_Register-Muska666-173262285.mp3')
const roundIt = compose(Math.round,
compose(Number,
getAmountAndSliceMxrbStr))