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
@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 / 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"