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
/*********************************************************************************** | |
*********************************************************************************** | |
** | |
** Author: Nick Bennett | |
** Email: [email protected] | |
** Github: https://github.com/tothebeat | |
** | |
** Image Tile - Arbitrary File | |
** Date Created: October 16, 2009 | |
** |
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
from TileImageClass import TileableImage | |
from TiledImageClass import TiledImage | |
import random | |
import Image | |
#import ImageDraw | |
import time | |
target_size = 256 | |
tile_size = 64 | |
image_source_folder = "./images/" |
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
import os | |
import shutil | |
import sys | |
# SEARCH_PATH = '.' | |
# DESTINATION_PATH = '' | |
def find_files_by_extension(search_path, extension): | |
all_files = [] | |
for root, dirs, files in os.walk(search_path): |
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 draw_fractal(n_columns=40, n_rows=20, | |
min_real=-1.5, min_imag=-1.0, max_real=1.0, max_imag=1.0, | |
max_iterations=200, render_chars = 'abcdefghijklmnopqrstuvw '): | |
''' | |
This renders a Mandelbrot set fractal in text mode. | |
http://en.wikipedia.org/wiki/Mandelbrot_set | |
Defaults: | |
def draw_fractal(n_columns=80, n_rows=40, |
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
from selenium import webdriver | |
profile = webdriver.FirefoxProfile() | |
# Set proxy settings to manual | |
profile.set_preference('network.proxy.type', 1) | |
# Set proxy to Tor client on localhost | |
profile.set_preference('network.proxy.socks', '127.0.0.1') | |
profile.set_preference('network.proxy.socks_port', 9050) | |
# Disable all images from loading, speeds page loading | |
# http://kb.mozillazine.org/Permissions.default.image |
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
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
import simplejson | |
import requests | |
# How many revisions are returned by each API call | |
# Keep this at 1 due to https://bugzilla.wikimedia.org/show_bug.cgi?id=29223 | |
rvlimit=1 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>The d3 test</title> | |
<style> | |
.chart { | |
shape-rendering: crispEdges; | |
} | |
.main text { |
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
import sys, threading, Queue, weakref | |
try: | |
import Tkinter | |
_has_tk = True | |
_debug_win = None | |
except ImportError: | |
# quietly disable ourselves | |
_has_tk = False |
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
import json | |
import unicodecsv | |
import requests | |
loan_ids_path = './loan_ids.csv' | |
# Kiva requests, but does not require, that developers use | |
# an app_id parameter in API requests. | |
APP_ID = 'edu.northwestern.nick' | |
NUM_API_CALLS = 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
export WORKON_HOME=$HOME/.virtualenvs | |
source /usr/local/bin/virtualenvwrapper.sh | |
# Reset | |
Color_Off='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green | |
Yellow='\e[0;33m' # Yellow |
OlderNewer