Skip to content

Instantly share code, notes, and snippets.

View rrdelaney's full-sized avatar

Ryan Delaney rrdelaney

View GitHub Profile
module Button = {
[@bs.module "semantic-ui-react"]
external reactClass : ReasonReact.reactClass =
"Button";
let make =
(
~active: option(Js.boolean)=?,
~basic: option(Js.boolean)=?,
~circular: option(Js.boolean)=?,
~className: option(string)=?,
@rrdelaney
rrdelaney / typescript.re
Created March 3, 2018 23:44
TypeScript Decoder
module Decoder = {
let node = json => {
let syntaxKind = json |> Json.Decode.field("kind", Json.Decode.int);
if (syntaxKind == Internal.SyntaxKind.declareKeyword) {
Unknown;
} else {
Unknown;
};
}
and declareKeyword = json =>

Keybase proof

I hereby claim:

  • I am rrdelaney on github.
  • I am rrdelaney (https://keybase.io/rrdelaney) on keybase.
  • I have a public key whose fingerprint is 9A26 F0AE 4E31 9452 58FB 997C 32A3 6088 94FF 47B0

To claim this, I am signing this object:

@rrdelaney
rrdelaney / AsyncIteratorMiddleware.ts
Created July 7, 2017 06:02
Redux Async Iterator
const asyncGeneratorMiddleware = async ({ dispatch }) => next => action => {
if (typeof action === 'function') {
for await (const _action of action()) {
dispatch(x)
}
} else {
return next(action)
}
}
@rrdelaney
rrdelaney / index.html
Created July 3, 2017 00:53
Mini React/Redux
<div id="root" />
@rrdelaney
rrdelaney / create-cluster.sh
Last active September 21, 2018 08:28
RethinkDB Cluster - Docker 1.12 Swarm Mode
docker network create -d overlay skynet
docker service create --name rethink-master --network skynet -p 8080:8080 rethinkdb rethinkdb --bind all
docker service create --name rethink-slave --mode global --mount type=bind,source=/var/lib/rethinkdb,target=/data --network skynet rethinkdb rethinkdb --bind all -j rethink-master
@rrdelaney
rrdelaney / bs.fish
Last active May 3, 2016 16:54
Fish Functions
function bs -d "Bootstraps a project environment"
if test -d ~/Documents/dev/$argv[1]
cd ~/Documents/dev/$argv[1]
else if test -d ~/Documents/dev/go/$argv[1]
cd ~/Documents/dev/go/$argv[1]
else if test -d ~/Documents/union/$argv[1]
cd ~/Documents/union/$argv[1]/$argv[1]
else if test -d ~/Documents/$argv[1]
cd ~/Documents/$argv[1]
else
@rrdelaney
rrdelaney / .travis.yml
Created January 17, 2016 04:10
Autodeploy to NPM with Travis CI
deploy:
provider: npm
email: "YOUR EMAIL"
api_key: $NPM_TOKEN
skip_cleanup: true
on:
branch: master
condition: $(npm view PACKAGENAME dist-tags.latest) != $(node -p "require('./package.json').version")
@rrdelaney
rrdelaney / rebaseify.sh
Last active August 29, 2015 14:27
Rebaseify!
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo "Rebasify!"
echo "Usage"
echo "rebaseify start"
echo " generates commit log for editing"
echo ""
echo "rebaseify finish"
echo " rebases on the edited commit log"