View BlurInterruptor.md

[PROOF OF CONCEPT] For when you want "tabbable" children (e.g. in Date selector composed of a textfield for Day, Month and year) but only want to perform validation on blur-entire-component not each Textfield

class BlurCapturer extends React.Component {
    static propTypes = {
        name: PropTypes.string.isRequired,
        onBlur: PropTypes.func,
        children: PropTypes.node,
View ag-snippets.md

ag -u -Q "autoprefixer({" .

View react-reason.md

Creation, Props & Self

  • just a record
  • need a make function
  • creates new component every JSX invocation
  • props = labeled arguments make, last prop must be chilren

Props Forwarding

View reasonml-docs.md

Language basics

let binding

let is just an expression and akin to a function!

let greeting = hello
let greeting = "hi"; /* shadowed */
let scoped = {
View auto-bisect.sh
#!/usr/bin/env bash
# https://lwn.net/Articles/317154/
# USAGE:
# 1. Place this file one level above the project folder
# 2. git bisect start <badSHA> <goodSHA>
# 3. chmod +x ../auto-bisect.sh
# 4. git bisect run ../auto-bisect.sh
rm -r .out
yarn;
View gist:628fc5be4a0c49894dae6f6203a5aba5
While such costs might be negligable for cold code, in the sort code comparator was invocated millions of times which made overheads of arguments adaptation quite pronounced.
View kk
#!/usr/bin/env bash
notify "kk."
View label.js
// Jests dont write to file in chron order, prefix with number helps
let count = 0;
const label = (tmpl, ...val) => {
val.reverse();
return `${
count++ // eslint-disable-line
}. ${
tmpl.reduce((p, c) => p + c + (val.length ? val.pop() : ''), '')
}`;
View createNumberFormatFromNumberToLocalString.js
// The following must be executed in browser, and can be pasted into
//
// WHY?
// 1. Browser support is a bit spotty
// 2. Testing with node framework made harder as node doesn't come with internationalistion (full-icu) data by default
// 3. Int shim is ~56Kb https://github.com/andyearnshaw/Intl.js/blob/master/dist/Intl.min.js. This is ~7kb
var getNumberFormatFromIso2 = (iso) => {
let thousandsSeparatorSymbol;
View Snippets.md

Glob

python << EOF
import glob
for name in glob.glob('/*'):
  print(name)
EOF