Skip to content

Instantly share code, notes, and snippets.

View aparrish's full-sized avatar

Allison Parrish aparrish

View GitHub Profile
@aparrish
aparrish / inform7_assertions.txt
Created July 9, 2014 20:07
"Inform 7 Assertions," a series of prose poems generated from "Writing with Inform" (http://inform7.com/learn/man/WritingWithInform.txt). I found every indented code snippet in the book that contained the phrase "is a(n)" and sorted them in alphabetical order.
A Bee Chamber is a kind of room. The printed name of a Bee
Chamber is usually "Hexagonal Room". The description of a
Bee Chamber is usually "Waxy, translucent walls surround
you on six sides; the floor and ceiling are made of the
same material, gently uneven. There are exits in every
direction, cut into the faces or the corners."
A Bengal tiger is a kind of animal.
A DVD is a kind of artwork.
@aparrish
aparrish / dreams.txt
Created November 24, 2014 16:57
Rough nanogenmo attempt, constructed by isolating actions from dreams in "Ten Thousand Dreams Interpreted, OR, WHAT'S IN A DREAM" http://www.gutenberg.org/ebooks/926
I was abandoned.
I abandoned others.
I abandoned.
I abandoned my sweetheart.
I abandoned a mistress.
I abandoned.
I abandoned children.
I abandoned my business.
I saw myself or friend abandon a ship.
I saw an abbey in ruins.
@aparrish
aparrish / exercise_a.txt
Created January 28, 2015 13:42
Programming Exercise A for RWET
RWET Programming Exercise A
Text processing on the UNIX command line
---
Step 1. Write the command to download the text file with the following URL to
your computer with the filename "frost.txt". (Hint: You'll need to use the
"curl" command, and possibly redirection with ">").
Here's the URL:
http://rwet.decontextualize.com/texts/frost.txt
@aparrish
aparrish / glitchstr.py
Created February 2, 2015 16:07
a little set of functions I've been using to create "glitchy" strings.
import random
def char_error(s):
t = ""
for ch in s:
if random.randrange(6) == 0:
t += chr(ord(ch)+random.choice([-1,1]))
else:
t += ch
return t
@aparrish
aparrish / exercise_b.py
Created February 10, 2015 15:53
RWET Programming Exercise B
#
# RWET Programming Exercise B
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
@aparrish
aparrish / exercise_c.py
Created February 25, 2015 05:49
Programming Exercise C for RWET (dictionaries, sets, list comprehensions)
#
# Worksheet #3
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
# In this worksheet, some of the tasks will throw an error that causes
@aparrish
aparrish / exercise_d.py
Created March 11, 2015 16:26
Programming exercise D for RWET
#
# Worksheet #4
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
# In this worksheet, some of the tasks will throw an error that causes

Python ITP Group Regular Expressions Tutorial

I'll be working from these notes:

Source texts we'll use (download these to your working directory):

@aparrish
aparrish / words_beginning_with_fleh.js
Created April 17, 2015 22:20
words beginning with fleh, a node example for parsing the CMU pronouncing dictionary
var fs = require('fs');
var dictionary = fs.readFileSync("cmudict-0.7b", {encoding: 'utf8'});
var lines = dictionary.split("\n");
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
if (/^;/.test(line)) { continue; }
if (line.length == 0) { continue; }
var parts = line.split(" ");
@aparrish
aparrish / twitterbot.md
Last active May 23, 2022 01:03
Make-A-Twitter-Bot Workshop