Skip to content

Instantly share code, notes, and snippets.

View s-m-i-t-a's full-sized avatar

Jindřich K. Smitka s-m-i-t-a

View GitHub Profile
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@s-m-i-t-a
s-m-i-t-a / machine.js
Last active March 25, 2020 18:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@s-m-i-t-a
s-m-i-t-a / machine.js
Created March 23, 2020 21:13
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@s-m-i-t-a
s-m-i-t-a / machine.js
Created March 18, 2020 11:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@s-m-i-t-a
s-m-i-t-a / Index.re
Created December 5, 2018 07:11 — forked from drejohnson/Index.re
basic reasonml binding for lit-html. WIP
/* Works but props not added to values array */
let sayHello = name =>
LitHtml.html(
{j|
<h1>Hello $(name) </h1>
<p>Goodbye</p>
<div>
<span>This is nested</span>
</div>
|j},
@s-m-i-t-a
s-m-i-t-a / Main.elm
Created July 14, 2018 05:18
How to update nested fields in record
module Main exposing (..)
type alias Bar =
{ baz : String }
type alias Foo =
{ bar : Bar }

Keybase proof

I hereby claim:

  • I am s-m-i-t-a on github.
  • I am smita (https://keybase.io/smita) on keybase.
  • I have a public key whose fingerprint is B53B 6946 2449 DDDF 617D DA8E BE91 15FF CC84 37D2

To claim this, I am signing this object:

@s-m-i-t-a
s-m-i-t-a / Update.elm
Created March 24, 2017 11:12
Dispatcher function for elm update functions.
module Update exposing (dispatch)
{-| Create update function
updater1 : Msg -> Model -> Maybe Model
updater1 msg model =
case msg of
Foo ->
Just { model | foo = "Foo" }
_ ->
@s-m-i-t-a
s-m-i-t-a / transducer.js
Last active February 21, 2017 09:11 — forked from bultas/transducer.js
Transducer to transform and convert native JS iterable data types
// MAIN iterator
function isInstanceOf(output, input, instanceOfType) {
return output ? output instanceof instanceOfType : input instanceof instanceOfType
}
function asSet(data) {
return new Set(data.values())
@s-m-i-t-a
s-m-i-t-a / check.sh
Last active March 6, 2019 08:26 — forked from bultas/pre-commit
Pre-commit to check tracked/commited js/jsx/py files with ESlint and pep8
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"