Skip to content

Instantly share code, notes, and snippets.

@derBingle
derBingle / local.js
Last active March 23, 2017 20:22
Get list of books from Google Books API
const apiKey = << API KEY HERE >>
const google = require('googleapis');
const serviceAccount = require('./key.json');
const { client_email, private_key } = serviceAccount;
const scope = 'https://www.googleapis.com/auth/books'
const client = new google.auth.JWT(client_email, null, private_key, scope, null);
client.authorize(function (err, tokens) {
if (err) {
@derBingle
derBingle / recp.zsh
Created September 8, 2017 17:05
Convert an OCaml file to Reason and copy to clipboard.
function recp () {
refmt --parse ml --print re "$@" | pbcopy;
}
@derBingle
derBingle / recp.zsh
Created September 8, 2017 17:41
Convert an OCaml file or the clipboard to Reason, and copy the result to the clipboard.
function recp () {
if [ $# -ge 1 -a -f "$1" ]
then
refmt --parse ml --print re "$@" | pbcopy;
else
pbpaste | refmt --parse ml --print re | pbcopy
fi
}
043555af2c290df0f5c704d0d782962300204ab85d14f6d70ce45206ea300485859a9956d461e809058de75da937eeb876f92a45900d3f7a3b75dc83912e58e762;mythic-forge-test