Skip to content

Instantly share code, notes, and snippets.

View litemerafrukt's full-sized avatar
🍍
Happy

Anders Nygren litemerafrukt

🍍
Happy
View GitHub Profile
@litemerafrukt
litemerafrukt / machine.js
Created November 18, 2020 22:16
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@litemerafrukt
litemerafrukt / machine.js
Last active November 18, 2020 18:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@litemerafrukt
litemerafrukt / machine.js
Created February 13, 2020 21:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
/* Action creators, reducer and types Quokka demo */
import thread from './thread'
const initialState = {
name: '',
points: 0,
likesGames: false
}
type State = typeof initialState;
export default function thread<A extends any[]>(...args: A) {
return function through<R>(fn1: (...args: A) => R, ...fns: Array<(a: R) => R>) {
let res = fn1(...args)
for (let i = 0, n = fns.length; i < n; i++) res = fns[i](res)
return res
}
}
import {
deleteAt,
map,
mapWithIndex,
reduceWithIndex,
isEmpty
} from 'fp-ts/lib/Record'
import { flow, not, tuple } from 'fp-ts/lib/function'
const o = { firstName: 'Foo', lastName: 'Bar' }
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
" set rtp+=~/.config/nvim/bundle/Vundle.vim
" call vundle#begin()
set rtp+=$HOME/.vim/bundle/Vundle.vim/
call vundle#begin('$HOME/.vim/bundle/')
" let Vundle manage Vundle, required
import createPolyfunc, { DEFAULT } from "./polyfunc";
const SULFURAS = "Sulfuras, Hand of Ragnaros";
const AGED_BRIE = "Aged Brie";
const BACKSTAGE = "Backstage passes to a TAFKAL80ETC concert";
export class Item {
constructor(name, sellIn, quality) {
this.name = name;
this.sellIn = sellIn;
import {
propOr,
prop,
identity,
compose,
split,
join,
toPairs,
reduce,
toLower
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
" set rtp+=~/.config/nvim/bundle/Vundle.vim
" call vundle#begin()
set rtp+=$HOME/.vim/bundle/Vundle.vim/
call vundle#begin('$HOME/.vim/bundle/')
" let Vundle manage Vundle, required