Skip to content

Instantly share code, notes, and snippets.

@justinwoo
justinwoo / imagechop.py
Last active December 9, 2015 23:18
Chops up an image so that it may be used for scrolling image videos. Not very sophisticated.
from PIL import Image
#what image?
im = Image.open("./xgCGa.jpg")
outdir = "./output/"
#define time to match
time = 177.0
frametime = .03
#define size of image
@justinwoo
justinwoo / colorbank.py
Created December 20, 2012 05:45
takes text from your clipboard and colors it in html using a generated colorbank
# generate a color bank from a file and feed into colorbank.txt
#use a mutable set to avoid duplicates
from sets import Set
colors = Set()
#get my colors from the file
finlines = open('sourcecolors.txt','r').readlines()
#sourcecolors.txt is the page source ripped from http://www.color-hex.com/.
for line in finlines:
@justinwoo
justinwoo / braincancer.py
Created December 26, 2012 05:12
this script will [le]terally give you brain cancer. This script takes what you have in your clipboard and "le transforms" it into moron-speak. e.g. the quick little brown fox jumps over the lazy dog -> le quick [le]ttle brown fox jumps ov[l]er le lazy dog. Use wisely and not in the presence of children.
#aka brain cancer
import win32clipboard as clippy
def main():
#gotta do this for clip board stuff
clippy.OpenClipboard()
cliptext = clippy.GetClipboardData()
outtext = ''
@justinwoo
justinwoo / chatbot.py
Last active December 10, 2015 09:38
A stupid IRC bot made in Python that just echoes back what is said. To be developed for actual applications later. Also hangs waiting for server responses, so... yeah. Not very smart.
#! /usr/bin/env python
# Justin Woo <moomoowoo@gmail.com>
# Usage:
# usage: chatbot.py [server] [nick] [channel]
# optional:
# -h, --help help
# required:
# [server] server to connect to
@justinwoo
justinwoo / fdata_bot.py
Last active December 10, 2015 10:59
moved to a repo due to inconvenience of gist layout: https://github.com/kimagure/framedata
#! /usr/bin/env python
# Justin Woo <moomoowoo@gmail.com>
# ver: dev
# Usage:
# usage: chatbot.py [server] [nick] [channel]
# optional:
# -h, --help help
# required:
@justinwoo
justinwoo / WTWfilterer.user.js
Last active December 10, 2015 16:28
Filters the Youtube "What to watch" page using discriminants set by the user, namely the age by days of the videos and whether or not they are recommended items. lemme know if there are bugs guys, it's 6am and i started this at 4:30am. Userscript page: http://userscripts.org/scripts/show/155774 edit: maybe i should replace inner html with outer …
// ==UserScript==
// @name Youtube Feed Filterer
// @namespace http://www.github.com/kimagure
// @description Filters the Youtube "What to watch" page using discriminants set by the user, namely the age by days of the videos and whether or not they are recommended items.
// @include http://www.youtube.com/*
// @include http://www.youtube.com/feed/what_to_watch
// @exclude http://www.youtube.com/watch?*
// @exclude http://www.youtube.com/user/*
// @exclude http://www.youtube.com/feed/*
// @version dev
@justinwoo
justinwoo / playlistmastheadreloactor.user.js
Last active December 10, 2015 16:59
moves the playlist mathead so that the "edit playlist" and "video manager" buttons and its bar are in a more sensible place (imo). Userscript page http://userscripts.org/scripts/show/155787
// ==UserScript==
// @name Youtube Playlist Masthead Relocator
// @namespace http://www.github.com/kimagure
// @description moves the playlist mathead so that the "edit playlist" and "video manager" buttons and its bar are in a more sensible place (imo)
// @include http://www.youtube.com/playlist?*
// @version dev
// ==/UserScript==
function relocations() {
var element = document.getElementById("masthead-subnav");
@justinwoo
justinwoo / subredditfilter.user.js
Created January 9, 2013 04:44
Filters out unwanted subreddits from /r/all. Userscripts page: http://userscripts.org/scripts/show/156068
// ==UserScript==
// @name Subreddit filter for /r/all
// @namespace http://www.github.com/kimagure
// @description Filters out unwanted subreddits from /r/all
// @include http://www.reddit.com/r/all*
// ==/UserScript==
bannedwords = [
'porn',
'craft'
@justinwoo
justinwoo / ApplistEngine.java
Created January 15, 2013 22:18
Looks up specified games on steam, steamappidlookup package used by using ApplistEngine methods .addEntry(Integer) and getting an ArrayList<string> returned from .getEntries() to get strings formatted ###: "appname". THAT'S RIGHT I THROW UP EXCEPTIONS IN YOUR FACE, DEAL WITH IT.
package steamappidlookup;
// doesn't actually help us get any better compiled code
// only for testing's sake
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Scanner;
import java.net.URL;
import java.net.URLConnection;
@justinwoo
justinwoo / multiprocesstest.py
Created January 18, 2013 03:53
just a template for myself
from multiprocessing import Process, Lock
def f(lock, name, number):
for x in range(1,100):
lock.acquire()
print '%s: %i' % (name, x)
lock.release()
if __name__ == '__main__':
lock = Lock()