Skip to content

Instantly share code, notes, and snippets.

View emattson's full-sized avatar
🎯
Focusing

Eli emattson

🎯
Focusing
View GitHub Profile
@emattson
emattson / install_postgresql_client.sh
Last active May 15, 2022 15:10
Install postgresql-client-10 on Debian 9
# taken from https://www.postgresql.org/download/linux/debian/
# assumes you are root
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
yes Y | apt-get install postgresql-client-10
@emattson
emattson / syntax-highlighting.sh
Created February 10, 2016 19:20
Terminal command to syntax highlight javascript text copied to clipboard (uses highlight)
pbpaste | highlight --syntax=js -O rtf -K 40 -k monokai -s seashell | pbcopy
@emattson
emattson / keybase.md
Created April 14, 2015 17:37
keybase.md

Keybase proof

I hereby claim:

  • I am emattson on github.
  • I am elimattson (https://keybase.io/elimattson) on keybase.
  • I have a public key whose fingerprint is 8372 DE5F 3B26 A02F 73FA FF4D B867 117A F3A5 04CC

To claim this, I am signing this object:

@emattson
emattson / count-identifiers.js
Created February 3, 2015 23:47
es5 version of count-identifiers
//es5
var parse = require("shift-parser").default;
var reduce = require("shift-reducer").default;
var MonoidalReducer = require("shift-reducer").MonoidalReducer;
//must return a Monoid
function IdentifierCounter() {
// a monoid over integers and addition
function Sum() {}
// by default reduce any node to the identity, zero
@emattson
emattson / count-identifiers.js
Created January 13, 2015 20:11
count-identifiers.js es6 version
//depends on shift-parser, shift-reducer, and shift MonoidalReducer
import parse from "shift-parser";
import reduce, {
MonoidalReducer
}
from "shift-reducer";
//IdentifierCounter inherits from MonoidalReducer
class IdentifierCounter extends MonoidalReducer {
npm install shift-reducer shift-parser
function f(s) {
s -> x + 1
}