This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for version in $(npm view $1 --json | jq '.versions[]' -c -r); do | |
sha=$(npm view $1@$version --json | jq '.gitHead' -c -r) | |
echo Tagging $sha as v$version | |
git tag -a "v$version" $sha -m "Release v$version" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const readline = require('readline') | |
const NORTH = 0b1000 | |
const SOUTH = 0b0100 | |
const EAST = 0b0010 | |
const WEST = 0b0001 | |
const ALL = 0b1111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const assert = require('assert') | |
const crypto = require('crypto') | |
module.exports = (min, max) => { | |
// borrowed from http://stackoverflow.com/a/33627342 | |
// figure out range and how many bytes required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charet="utf-8"/> | |
<style> | |
canvas { | |
image-rendering: crisp-edges; | |
margin: 5px; | |
} | |
canvas.horizontal { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const { runMain, show } = require('bench') | |
const express = require('express'); | |
const Seneca = require('seneca'); | |
const SenecaWeb = require('seneca-web'); | |
const adapter = require('..'); | |
const Request = require('request') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am tswaters on github. | |
* I am tswaters (https://keybase.io/tswaters) on keybase. | |
* I have a public key ASAm_89GCHVXoI95zX9hNRCPpZH-qf9RlS2mR4qQBBHWOgo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SESSION app.id TO DEFAULT; | |
SET ROLE postgres; | |
SET search_path = 'public'; | |
DROP TABLE IF EXISTS expenses CASCADE; | |
DROP TABLE IF EXISTS projects CASCADE; | |
DROP TABLE IF EXISTS users CASCADE; | |
CREATE TABLE users ( | |
user_name text PRIMARY KEY NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
// error-prone work function | |
const _work = (name, failure_rate) => (thing) => | |
new Promise((resolve, reject) => { | |
setTimeout(() => { | |
if (Math.random() < failure_rate) { | |
console.log(`${name} failed - ${JSON.stringify(thing)}`) | |
reject(new Error(`${name} hit above ${failure_rate}`)) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import readline from 'readline' | |
const w = process.stdout.columns | |
const h = process.stdout.rows | |
const init = () => Array.from({ length: w * h }).map(() => Math.round(Math.random())) | |
let state = init() | |
const deindex = (i) => [i % w, Math.floor(i / w)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>How to center text</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<table style="width: 100%; height: 100%; position:absolute;"> | |
<tr> | |
<td valign="middle" align="center"> |