Skip to content

Instantly share code, notes, and snippets.

View ben-x9's full-sized avatar

Benjamin James ben-x9

View GitHub Profile
@ben-x9
ben-x9 / sig
Last active October 4, 2017 04:44
#!/bin/sh
# Works with merlin version 2.5.4. Using protocol described at
# https://github.com/ocaml/merlin/blob/master/doc/dev/OLD-PROTOCOL.md#type-checking
usage ()
{
echo
echo Generate a signature for a Bucklescript module.
echo
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
index: ['./app/core'],
},
output: {
publicPath: '/',
filename: 'bundle.js',
// Tic Tac Toe State Machine
// interface that implements the following function
// makeMove(r, c) -> one of the following enum values describing the state of the game after the given move.
// 1. INCOMPLETE - the given moven was valid, there remain open spaces, and there are no winners.
// 2. INVALID -- the previous play was out of bounds (0 < x < 2), or a piece already occupied the given position
// 3. X_WINS -- X is winning along either a row, column, or diagonal
// 4. O_WINS -- same as above except for O
// 5. STALEMATE -- the previous move was valid, there are no winners, but there remain open spaces.
// makeMove is called alternatingly by X and O players (X is first).
// Use this file instead of coffee-script/register
require('coffee-script/register');
require('regenerator/runtime');
var CoffeeScript = require('coffee-script');
var recast = require('recast');
var regenerator = require('regenerator');
var convertSourceMap = require('convert-source-map');
require.extensions['.coffee'] = function (module, filename) {
@ben-x9
ben-x9 / bookmarklet
Last active August 29, 2015 14:24 — forked from zenlor/bookmarklet
(function(d, u) {
var s = d.createElement('script');
s.src = u;
s.async = !!1;
(d.head || d.getElementsByTagName('head')[0]).appendChild(s);
}(document, 'https://gist.githubusercontent.com/benlambt/3a3cddcb17495fd4732e/raw/ac557da4c61e8f7b8ac78d8a57c29e333a1ba52b/snippet.js'));
(function(d){var a=d.createElement("script");a.src="https://gist.githubusercontent.com/benlambt/3a3cddcb17495fd4732e/raw/ac557da4c61e8f7b8ac78d8a57c29e333a1ba52b/snippet.js";a.async=!0;d.head.appendChild(a);}(document))();
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here:
Michael Chletsos 11/26/11 9:04 AM
It does NOT work in QA for me
Ben Lambert 11/26/11 9:04 AM
hmm
11/26/11 9:06 AM
it just worked for me in Safari
Michael Chletsos 11/26/11 9:06 AM
hold on
Ben Lambert 11/26/11 9:06 AM
https://qa.assembla.com/spaces/cachamate/wiki/aNWctABdqr4kkmeJe5cbLr/edit
@ben-x9
ben-x9 / gist:1116414
Created July 31, 2011 04:48
brew doctor
/usr/bin is in your PATH before Homebrew's bin. This means that system-
provided programs will be used before Homebrew-provided ones. This is an
issue if you install, for instance, Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.
@ben-x9
ben-x9 / gist:1116413
Created July 31, 2011 04:48
brew install -v gs
==> Downloading http://downloads.ghostscript.com/public/ghostscript-9.02.tar.bz2
File already downloaded in /Users/work/Library/Caches/Homebrew
/usr/bin/tar xf /Users/work/Library/Caches/Homebrew/ghostscript-9.02.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/ghostscript/9.02 --disable-debug --disable-cups --disable-compile-inits --disable-gtk
./configure --prefix=/usr/local/Cellar/ghostscript/9.02 --disable-debug --disable-cups --disable-compile-inits --disable-gtk
configure: WARNING: unrecognized options: --disable-debug
checking for gcc... /usr/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
@ben-x9
ben-x9 / gist:1116337
Created July 31, 2011 03:14
`brew doctor` output
/usr/bin is in your PATH before Homebrew's bin. This means that system-
provided programs will be used before Homebrew-provided ones. This is an
issue if you install, for instance, Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.