Skip to content

Instantly share code, notes, and snippets.

for (var i = 0; i<=100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
console.log("cracklepop");
}
else if (i % 5 == 0) {
console.log("pop");
}
else if (i % 3 == 0) {
console.log("crackle");
}
#import the csv module which we'll need to read and write our csv's
import csv
#import the shutil module which we use to create a copy of our original csv
import shutil
#import the Nominatim module from geopy, a bit more on this in the text below
from geopy.geocoders import Nominatim
geolocator = Nominatim()
@rlieberman
rlieberman / midterm_functions.py
Created May 11, 2015 20:32
Main script to create complex shape outputs with just a few lines of code!
#import functions from my module shapeshift
from shapeshift import sawToothLeft, sawToothRight, diamondChain, hourGlass, checkerBoard
#create the different shapes using my module
diamondChain(3, 6)
sawToothLeft(3,8)
sawToothRight(3,8)
hourGlass(10, 6)
@rlieberman
rlieberman / shapeshift.py
Created May 11, 2015 20:31
Module for Shapeshift functions (RWET midterm)
#Module for shapeshift functions
import sys
import random
words_by_len = dict() #create an empty dictionary to store words by their length
#Create a dictionary where the key is the # of characters in the word and the value is a list of words
for line in sys.stdin: #load each line from standard in
@rlieberman
rlieberman / itsees.py
Created May 11, 2015 02:53
RWET Final Project by Rebecca Lieberman, ITP Spring 2015
#IT SEES by Rebecca Lieberman
#Final Project for Reading and Writing Electronic Text @ ITP, taught by Allison Parrish
#Spring 2015
#Code sources --
#Bing Search API Python Wrapper https://github.com/xthepoet/pyBingSearchAPI
#Script that fetches image descriptions from Toronto Deep Learning https://github.com/cmyr/INTERESTING_JPG
#STEPS TO RUN THIS CODE:
#1. create a virtual environment in your project directory
@rlieberman
rlieberman / @dronesweetie
Created May 10, 2015 19:48
A Twitter bot that tweets computer-generated descriptions of images of drones
#DRONE SWEETIE: a Twitter bot that tweets descriptions of images of drones
#Code sources --
#Bing Search API Python Wrapper https://github.com/xthepoet/pyBingSearchAPI
#Script that fetches image descriptions from Toronto Deep Learning https://github.com/cmyr/INTERESTING_JPG
#STEPS TO RUN THIS CODE:
#1. create a virtual environment in your project directory
#2. install textblob, requests and beautiful soup to your virtual env
#3. run dronesweetie.py with a sys.argv input from the command line
#4. make sure the following two modules are in your project directory (+download them with the following links):
#RWET Assignment 3: Wordnik API Poems
#Rebecca Lieberman
#ITP Spring 2015
import sys
import urllib
import json
word = sys.argv[1]
@rlieberman
rlieberman / rwet_midterm_shapeshift.py
Last active August 29, 2015 14:17
A script to create visual poems in Python, made for RWET Midterm by Rebecca Lieberman.
#SHAPESHIFT: A Poetic Form by Rebecca Lieberman
#Reading and Writing Electronic Text Midterm Project
#Made at ITP, Spring 2015
import sys
import random
words_by_len = dict() #create an empty dictionary to store words by their length
import random
airstrike_list = list() #make an empty list for the words in airstrike
all_words = list () #make an empty list called all_words
meat = open('meat.txt').read() #load meat into a string
for item in meat.split(): #load the words in meat into the list
all_words.append(item)
for line in open('airstrike.txt'): #for each line in airstrike.txt
import random
all_words = list () #make an empty list called all_words
meat = open('meat.txt').read() #load meat and air strike into strings
airstrike = open('airstrike.txt').read()
for item in meat.split(): #load meat into the list
all_words.append(item)