Skip to content

Instantly share code, notes, and snippets.


gregory tomlinson gtzilla

Block or report user

Report or block gtzilla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gtzilla / module_initialized.commander.js
Last active Dec 2, 2018
Parse alternate to `process.argv`. IF/ELSE loads from CLI and loads from inclusion in another script
View module_initialized.commander.js
initialize from alternate in CLI commander.js script
Included as a module in nodejs
instead of process.argv
if (require.main === module) {
gtzilla / helpers.js
Last active May 2, 2016
JavaScript closure state manager for a single argument, with support for default state initialization value. A JavaScript private variables method.
View helpers.js
;(function(window) {
'use strict';
filename: helpers.js
author: gregory tomlinson
license: MIT
Be a "utility" helper method
file that is namespaced to 'helpers'
ColinEberhardt / .block
Last active Oct 27, 2019
d3fc-label-layout map example
View .block
license: mit
gabrielelana / Vagrantfile
Last active Nov 18, 2019
How to create a VirtualBox machine with encrypted storage with Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
malarkey / Contract Killer
Last active Dec 4, 2019
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

View gist:1345636
# FIXME This is a **terrible** hack. This logic should really be
# in the model. It's very difficult to put it there because we
# can only perform index updates here, in the API layer, because
# of the way we mix sync/async code. You should be shaking your
# head in disgust the entire time you read this code and be
# thinking, "What kind of fucking muppet would even think this is
# a good idea?! ZOMG!!"
gtzilla / regex_compile_test2.js
Created Oct 26, 2011
Regex Test, consistent fail on every other when matching - or !
View regex_compile_test2.js
var raw_str_regex = "-([a-zA-Z0-9_]+)$";
var regex = new RegExp(raw_str_regex, "gm");
var lst = [
"this is -not",
"this is -not",
"this is -not",
"this is -not",
"this is -not",
"this is -not"
""" A script to attempt the compression of written english
to the chinese character set """
import os
from collections import OrderedDict
from math import log
import itertools
from collections import Counter
"""Monads in Python, as close as I can get them to
class Monad(object):
def return_(self, value):
raise NotImplementedError()
def __ge__(self, mf):
raise NotImplementedError()
def charorquoted(strn):
c = anychar(strn)
if c[0] == '"':
return None
elif c[0] == '\\':
c2 = anychar(c[1])
if c2[0] in ('\\', '"'):
return (c[0] + c2[0], c2[1])
return c
You can’t perform that action at this time.