View Reason-Option-Iterop-Issue.md

I wanted to make an npm module via ReasonML

  • a function need to accept objects
  • but couldn't find a way to convert an JS Object to a Reason Record (holds optional value)
// I wanted to have an npm module function like below
reasonFnExposedToJs({key1: 'blah', key2: undefined})

// and works fine with Reason side but generated argsFromJs looks like below
View ttl.jsx
const ttl = (strings, ...variables) => [strings, ...variables]
// or const ttl = (...args) => [...args]
// we are using www.styled-components.com as an example
const Adder = ({className, x, y}) => {
return (
<span className={className}> {x+y} </span>
)
}
View no-concurrency-promise.js
function printTo100(n) {
for (i in [...Array(100).keys()]){
console.log(`${n}-${i}`)
}
return Promise.resolve()
}
Promise.all(
printTo100('a'),
printTo100('b'),
View useful-commands.sh
# find a process using port 3000 via https://unix.stackexchange.com/a/106562
sudo lsof -n -i :3000 | grep LISTEN
# export env vars from a file via https://github.com/sunghyunzz
export $(cat .env | xargs)
View example.js
const { hss, scene, storage, market } = require('hire-scene-stealer')
hss
.scene(scene
.url('https://google.com')
.selector('img#hplogo')
.domIndex(0) // you can skip if it's 0
.viewport(900, 700)
)
.storage(storage
View Echo.elm
port module Echo exposing (..)
import Platform exposing (program, Program)
import Json.Decode
-- importing Json.Decode is necessary for now because of https://github.com/elm-lang/elm-make/issues/127
---- MODEL ----
type alias Model =
{ crap : String }
View install-docker-ce-on-loki.sh
#!/usr/bin/env bash
# based on https://store.docker.com/editions/community/docker-ce-server-ubuntu
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt update
sudo apt-get install -y docker-ce
sudo usermod -aG docker $USER
View 0-papercliper-fog-gcs.md

An example code to use GCS instead of S3

View env-strip.sh
#!/usr/bin/env bash
## strip newlines of envs
# used some code from http://stackoverflow.com/a/11746174
string=`printenv`
arr=()
while read -r line; do
arr+=("$line")