Skip to content

Instantly share code, notes, and snippets.

@racheltwu
racheltwu / creepypasta-tracker.js
Last active February 8, 2016 22:31
Creepypasta Tracker allows you to keep track of which pastas you've read on the "Ratings Index" pages.
// ==UserScript==
// @name Mark Read Creepypasta.com
// @namespace http://herbalcell.com
// @version 0.4
// @description Mark stories as read on Creepypasta.com
// @match http://www.creepypasta.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @require https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// ==/UserScript==
@racheltwu
racheltwu / youtube-hide-watched-videos.js
Last active September 7, 2016 19:38
YouTube Hide Watched is a userscript allowing you to keep track of which videos you've watched by X'ing them. It works on many of the pages where videos show in a list, and stays after refreshing (do not clear cookies to maintain which ones stay hidden). There is a "Show hidden" button at the bottom of the page to temporarily reshow.
// ==UserScript==
// @name Hide videos seen on Youtube
// @namespace http://youtube.com
// @version 1.0
// @description Hide videos seen on Youtube, on any page, by X'ing them
// @include https://www.youtube.com/*
// @exclude https://www.youtube.com/user/*/playlists
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @require https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// ==/UserScript==
@racheltwu
racheltwu / grab-new-wallpaper.py
Last active March 1, 2016 21:05
Downloads a random wallpaper based on preset search terms using Google API. Read tutorial of how to install it here: http://herbalcell.com/automatic-daily-wallpaper
from urllib import urlencode
from urllib2 import urlopen
import re
import json
from pprint import pprint
from random import randint
from os import remove, path
from time import sleep
from glob import glob
import re
def longestDuplicateNonOverlappingSubstring(string, minimum_length_of_substring=4):
substrings = []
# Create list of every substring
# ['b', 'ba', 'ban', 'bana', 'banan', 'banana', 'a', 'an', 'ana', ...]
for i in xrange(len(string)):
for j in xrange(i, len(string)):
sub = string[i:j+1]
substrings.append(sub)