Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- My implementation of the State monad!
module MyState
( MyState(..)
) where
newtype MyState s a = MyState { runState :: s -> (a, s) }
instance Functor (MyState s) where
fmap f myState = MyState
#!/bin/sh
yarn && yarn db:migrate && yarn build:dll && yarn build:relay
@dan-f
dan-f / id_rsa.pub
Created November 15, 2016 19:55
Thinkpad X1 Carbon Public SSH Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCbv6oIlHFFqEJnAvdelqCj/cROCXZMv7F3sylRdDdno71WqEjnsJzlg1c8PumDrpqXK0Avf14qiEb0XC8JRlF8sIFBw97/ud5281nAPjpWb8l5HiRyZYvT2KSOUhWlbbf7DI9sdA/qawOnrBxZOCrsvyEM+VSv4hSPbHOG0WXuIHpkqc9sXGzOyOVmHG3yaXqR+z42zVXTIOT5hztM5RksiQg6lGB1aNVv0q1CNO90BWARNfAWr692lotnJHqK4iJE98eNmjYfsti91Z5i00SMuhK530RqVCvf3yy0wAxYxmguIfyHEGXxc5rQEo2ojaZPwWZ6ifM9U+cdvpGWQwSsoiT/0iFMt2lFj2/amWwLNg7hAGbk12mAah4sLQSOJmmD8gghQKhUjkQ4qg3F+JxvFDvPJem6972bKXA/MA81WiQwRiiEfmyXRTkA4MMMf86fFOyIzJjz8FtNHhJeY8TnPcKiKbdAH1z+ZOewEoRXeLWLciNZVMyc3Ho88Anq8gR5hjEfBUF4DSVpeOPbBVd2YH2Z+CIcyfcmXY6uzkWBL9flB8sHyF0JzVW3NnDEwFhyVLiWepmzQsPrER0Oz5s0sz+rNC13NhrhXzF45Fehq9ka2yzkRCjVBhLQdjttiFk3Owq8/KfYwKlaBMmKy6Bk9WhnJ8c/7rFFxVgG8uMb5w== dfriedman58@gmail.com
@dan-f
dan-f / package.json
Last active August 25, 2016 19:46
basic npm scripts
{
"scripts": {
"build": "echo 'TODO: implement build script' && exit 1",
"lint": "echo 'TODO: implement lint script' && exit 1",
"test": "echo 'TODO: implement test script' && exit 1",
"pretest": "npm run lint",
"preversion": "npm test",
"postversion": "git push --follow-tags",
"prepublish": "npm run build"
}
@dan-f
dan-f / keybase.md
Created May 10, 2016 18:32
Keybase Proof

Keybase proof

I hereby claim:

  • I am dan-f on github.
  • I am dan_f (https://keybase.io/dan_f) on keybase.
  • I have a public key whose fingerprint is 3BA8 7B50 2AE8 1CF9 1D9A 8CED FD91 480A 51EF E3BC

To claim this, I am signing this object:

@dan-f
dan-f / HtmlUtils.js
Last active March 11, 2016 20:33
Utilities for escaping and interpolating HTML strings in JS
// Requires underscore.js
var HTML,
Html;
HTML = function HTML (string) {
this.string = string;
};
HTML.prototype.toString = function toString() {
return this.string.toString();
}
@dan-f
dan-f / parseQueryString.js
Created February 9, 2016 16:26
Parses a querystring from the URL fragment
/**
* Converts the querystring portion of the URL into an object
* mapping keys to argument values.
*
* Examples:
* - 'foo=bar&baz=quux' -> {foo: 'bar', baz: 'quux'}
* - 'foo=bar&' -> {foo: 'bar'}
* - 'foo=bar&baz' -> {foo: 'bar', baz: ''}
* - 'foo=bar&baz=' -> {foo: 'bar', baz: ''}
*
@dan-f
dan-f / fix_devstack_mongo.sh
Created April 13, 2015 14:43
Fix mongo in devstack
# Run as the vagrant user
sudo rm /edx/var/mongo/mongodb/mongod.lock; sudo service mongod start