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
/* | |
initialize from alternate in CLI commander.js script | |
Included as a module in nodejs | |
instead of process.argv | |
https://github.com/tj/commander.js/ | |
*/ | |
if (require.main === module) { |
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
;(function(window) { | |
'use strict'; | |
/** | |
filename: helpers.js | |
author: gregory tomlinson | |
license: MIT | |
Be a "utility" helper method | |
file that is namespaced to 'helpers' |
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
license: mit |
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
# -*- 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 |
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
# 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!!" |
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
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" |
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
""" 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 | |
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
"""Monads in Python, as close as I can get them to | |
Haskell | |
""" | |
class Monad(object): | |
def return_(self, value): | |
raise NotImplementedError() | |
def __ge__(self, mf): | |
raise NotImplementedError() |
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
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]) | |
else: | |
return c |
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 python | |
""" | |
Add php-serve.py to your PATH, then, from whatever directory is the root | |
of your PHP application, just run: | |
$ php-serve.py | |
You can optionally specify a port number as an argument. By default, | |
port 8000 is used: |
NewerOlder