Skip to content

Instantly share code, notes, and snippets.

Stephen Krewson StephenKrewson

Block or report user

Report or block StephenKrewson

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
View keybase.md

Keybase proof

I hereby claim:

  • I am StephenKrewson on github.
  • I am stephen_krewson (https://keybase.io/stephen_krewson) on keybase.
  • I have a public key whose fingerprint is 7BAF 95A8 21A8 C7CB F07D A8B1 C43A F4D7 1E8B 2DDE

To claim this, I am signing this object:

View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@StephenKrewson
StephenKrewson / gist:7147625
Created Oct 25, 2013
JPEG Semantic Glitcher
View gist:7147625
import time
start_time = time.clock()
#############################################
# myProgram.py | inputDir | print? | min_word | delete? | shift | Oulipo? | N + ?
#############################################
import sys, re, string, random # Import required modules
from collections import defaultdict
from itertools import chain
from os import walk, path
#############################################
@StephenKrewson
StephenKrewson / Twitter Random Language Poetry
Last active Dec 16, 2015
~twitter poems~ (debuted at XS Collaborative exhibition with Hans Schoenburg, New Haven, April 2013)
View Twitter Random Language Poetry
import re, sys, nltk, string, matplotlib, HTMLParser
from nltk.corpus import cmudict
from random import choice, randint
from nltk.tokenize import *
from nltk import FreqDist
from twython import Twython
# OAuth2 authentication
t = Twython('',
'',
@StephenKrewson
StephenKrewson / clarissa.py
Last active Dec 14, 2015
This script was designed to read through a text file of Samuel Richardson's Collection of the Moral and Instructive Sentiments [1755] digitized by Eighteenth Century Collections Online and the Text Creation Partnership.
View clarissa.py
import re, sys
from collections import defaultdict
romanNum = {'i':1, 'ii':2, 'iii':3, 'iv':4, 'v':5, 'vi':6, 'vii':7, 'viii':8}
def Roman(num):
"""Hack for dealing with volume numbers less than nine"""
if num.lower() in romanNum:
return romanNum[num.lower()]
f1 = open(sys.argv[1], 'r') # Read in CMIS file
f2 = open(sys.argv[2], 'r') # Read in Table of Contents file
topics = [line.strip() for line in f2 if len(line) > 3] # Create array of topics
You can’t perform that action at this time.