Skip to content

Instantly share code, notes, and snippets.

View thricedotted's full-sized avatar

li zi thricedotted

View GitHub Profile
@thricedotted
thricedotted / werds.py
Last active November 3, 2020 23:44
werds generator
import wordfilter
from nltk.corpus import wordnet as wn
VOWELS = 'aeiou'
wordfilter.add_words(['.', '_', '-'])
werds = []
def replace_vowels(lemma):
@thricedotted
thricedotted / gtc_pronoun_count.py
Last active February 25, 2016 21:11
i got an email from nvidia trying to sell me on their deep learning/ai sessions. suffice it to say i am not sold
from lxml import html
import requests
GTC_URI = 'https://mygtc.gputechconf.com/form/session-listing&doSearch=true&queryInput=&topic_selector=Deep+Learning+%26+Artificial+Intelligence'
page = requests.get(GTC_URI)
tree = html.fromstring(page.content)
bios = [b.text for b in tree.cssselect('.session-speaker-bio')]
@thricedotted
thricedotted / bot_response.py
Created May 5, 2015 14:16
7on7 bot response
import codecs
import random
import pyttsx
from nltk.corpus import wordnet as wn
from pattern.en import parsetree, conjugate, pprint
class NoDefinitionError(Exception):
pass
ifneq (,$(DEBUG))
ETC = -g -DSELF_EDIT
else
ETC = -DNDEBUG
endif
GCC = g++
AR = ar
PRODUCT=Jumpcore
@thricedotted
thricedotted / pieceofshit.py
Last active August 29, 2015 14:05
this script lets twitter tell u that ur a piece of shit in real time
from __future__ import unicode_literals
from twython import TwythonStreamer, TwythonError
import time
import pyttsx
# too lazy to ask twr for handle. u put ur handle here
MY_HANDLE = 'thricedotted'
# im shitty so i put my credentials in a plain file lol
SYNTAX: @mnesynometron [...] <trigger phrase> do something <time expression> [...]
* trigger phrases (fixed): ["remind me to", "tell me to", "i need to", "i gotta", "i have to", "don't let me forget to", "make sure i", "remind me that", "tell me that", "don't let me forget that"]
* time expressions (examples): at 5pm tomorrow, in five minutes, tomorrow morning, in an hour, on wednesday at 10:30am
---
if yr tweet is parsed properly, @mnesynometron will fav it and get back to you at the time you specified (hopefully)
# syllables.py
# ------------
# get cmu_dict_file from http://webdocs.cs.ualberta.ca/~kondrak/cmudict.html
from collections import defaultdict
PHONEMES = set(['AA', 'AH', 'AW', 'B', 'D', 'EH', 'EY', 'G', 'IH', 'JH', 'L', 'N', 'OW' , 'P', 'S', 'T', 'UH', 'V', 'Y', 'ZH', 'AE', 'AO', 'AY', 'CH', 'DH' , 'ER', 'F', 'HH', 'IY', 'K', 'M', 'NG', 'OY', 'R', 'SH', 'TH' , 'UW', 'W', 'Z'])
VOWEL_PHONEMES = set(['AA', 'AH', 'AW', 'EH', 'ER', 'EY', 'IH', 'OW' , 'UH', 'AE', 'AO', 'AY', 'IY', 'OY', 'UW'])
#!/usr/bin/env python2
# screamtitles.py
# ---------------
# for @inky re: https://twitter.com/inky/status/475023831770595328
from __future__ import division
import sys
import codecs
@thricedotted
thricedotted / badjokebot_censor.js
Last active November 22, 2015 17:25
@badjokebot censoring userscript
// ==UserScript==
// @name @badjokebot answer blocker
// @version 0.1
// @description blacks out badjokebot answers, shows on hover
// @match https://*.twitter.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @copyright whatever
// ==/UserScript==
@thricedotted
thricedotted / twee.vim
Last active October 30, 2023 15:32
a rudimentary vim syntax file for twee code (http://www.gimcrackd.com/etc/src/) to use on .tw files automatically 1) save this file as ~/.vim/syntax/twee.vim 2) add this line to ~/.vimrc: au BufNewFile,BufRead *.tw set filetype=twee
" Vim syntax file
" Language: twee
" Maintainer: [email protected] / who even knows
" Latest Revision: 16 Sep 2013
" Version: 0.1
"
" TODO:
" - numbers in <<macros>> could be way more robust
" - different highlighting for choices and actions?
" - folding stuff???