Skip to content

Instantly share code, notes, and snippets.

@inky
inky / shell.sh
Created January 31, 2014 09:46
What's My Shell?
ps -p $$
echo $SHELL
@inky
inky / gist:8752247
Created February 1, 2014 13:15
Half-assed IE6 support (Feb 2012)
Half-assed IE6 support
- Follow float: (left|right) with display: inline
- Always specify full x,y coords for position: absolute
- If setting an image width, set height: 100% (or auto?)
- Avoid border-color: transparent
#!/bin/sh
set -o errexit # exit on error
set -o nounset # treat unset variables as an error
argc=$#
weeks=0
if [ $argc -ge 1 ]; then
if [ $1 -ge 1 ] && [ $1 -lt 100 ]; then
weeks=$1
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
import re
import sys
GUTENBERG_START = re.compile(r'\*\*\*.*START.*PROJECT GUTENBERG')
GUTENBERG_END = re.compile('End of.*Project Gutenberg')
def parse_gutenberg(fp):
for line in fp:
if GUTENBERG_START.match(line):
break
$ python secret123.py
f3M8VZEHb2/VAuKJScJAMYNuiawQr8q2^%s+K@ShK2M
@inky
inky / git-devinit.sh
Created May 26, 2014 23:34
Initialise a git repository and replace the 'master' branch with 'develop' and 'release'.
#!/bin/sh
set -o errexit
set -o nounset
git symbolic-ref -q HEAD 2> /dev/null && {
echo 'error: a git repository already exists'
exit 1
}
git init
git commit -m Init --allow-empty
git branch develop master
@inky
inky / README
Last active August 29, 2015 14:01
creepy shakespeare
Requires shakespeare_sonnets.json from https://github.com/dariusk/corpora
python transform_data.py > lines.txt
python creep.py
@inky
inky / README
Created June 8, 2014 12:19
WordFilter for bot corpora
A Python class for filtering a set of English words.
Wildcard patterns are read from a file named ignore.txt.
Requires the CLiPS Pattern library: http://www.clips.ua.ac.be/pages/pattern
def make_slug(text)
text.downcase.split.map{ |w| w.delete '^a-z0-9' }.reject(&:empty?).join('-')
end