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 | |
""" | |
Experiment with automatic generation of English plurals. | |
""" | |
import os | |
import random | |
def main(): | |
total_count = 0 |
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
#!/bin/sh | |
# Start a debug SMTP server using Python's smtpd module | |
show() { | |
echo 1>&2 "$@" | |
} | |
port=${1-25} | |
smtpd_args="-c DebuggingServer localhost:$port" |
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 read_requirements(filename='requirements.txt'): | |
"""Reads the list of requirements from given file. | |
:param filename: Filename to read the requirements from. | |
Uses ``'requirements.txt'`` by default. | |
:return: Requirments as list of strings. | |
""" | |
# allow for some leeway with the argument | |
if not filename.startswith('requirements'): |
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 | |
""" | |
{project} | |
====================================== | |
{description} | |
""" | |
import ast | |
import os | |
from setuptools import find_packages, setup |
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
""" | |
Extensions to the standard Python mock library. | |
Use it instead of the library itself. | |
""" | |
from __future__ import absolute_import | |
try: | |
from unittest.mock import * | |
except ImportErorr: | |
from mock import * |
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/expect -- | |
# Purge local memcache, flushing all the keys & values | |
set escapechar !; # easier to send than default ^] | |
set host [lindex $argv 1]; | |
if { ![string length $host] } { | |
set host "localhost"; | |
} |
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 interruptibleFadeOut(element, options) { | |
if (typeof options === 'number') { | |
options = {fadeOut: options}; | |
} | |
element = $(element); | |
return new Promise(function(resolve) { | |
// Event handlers used by the effect. | |
var events = { | |
mouseenter: function() { interruptAnimation(); }, |
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 runhaskell | |
-- Preview structured text files in the browser | |
-- Usage: $ preview FILE [BROWSER] | |
-- by Karol Kuczmarski "Xion" -- 25 August 2013 | |
import Control.Exception (bracket) | |
import System.Environment (getArgs) | |
import System.Directory (getTemporaryDirectory) |
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
-- Coded4.hs | |
-- Simplified version of coded4 analyzer (http://github.com/Xion/coded4) | |
-- Supports only Git repositories and produces less neatly formatted output | |
-- usage: | |
-- $ runghc Coded4.hs <path-to-git-repo> | |
module Coded4 where |