Skip to content

Instantly share code, notes, and snippets.

@pfeyz
pfeyz / mixed-effects-preprocessing.ipynb
Created July 9, 2018 19:56
mixed-effects-preprocessing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### Keybase proof
I hereby claim:
* I am pfeyz on github.
* I am pfeyz (https://keybase.io/pfeyz) on keybase.
* I have a public key whose fingerprint is B83B 4D16 799C 3DD5 DB31 AF7C D84C 25FF 6148 862E
To claim this, I am signing this object:
@pfeyz
pfeyz / bulk-send.py
Last active December 23, 2015 10:49
"""
$ python bulk-send.py emails.txt passes/*.pdf # dry run
Logging into smtp.gmail.com:587 as firstname.lastname
(Not actually sending anything. Use -s to actually send the emails.)
1.pdf -> a@gmail.com
2.pdf -> b@gmail.com
3.pdf -> c@gmail.com
...
$ python bulk-send.py -s emails.txt passes/*.pdf # send for real
@pfeyz
pfeyz / bulk-
Created September 19, 2013 14:08
"""
usage: Send a unique attachment to every email in a list.
$ python bulk-send.py emails.txt passes/*.pdf # dry run
Logging into smtp.gmail.com:587 as paul.feitzinger
(Not actually sending anything)
1.pdf -> a@gmail.com
2.pdf -> b@gmail.com
3.pdf -> c@gmail.com
...
import glob
import os
import re
import sys
import warnings
from preprocessing import MorParser
from analysis.scripts.analyze_tagset import analyze
from analysis.scripts.sanitize_stats_files import main as sanitizer
def cmoney(filename, speaker, corpname, period_num):
<script language="JavaScript">
function decode_letter(encoded_letter, salt, total_words, word_index){
return String.fromCharCode(parseInt(encoded_letter) + salt - total_words + word_index);
}
function encode_letter(letter, salt, total_words, word_index){
return String.charCodeAt(letter) - salt + total_words - word_index;
}
function encode_words(words, salt){
import sys
from mwapi import LearnersDictionary
if __name__ == "__main__":
query = " ".join(sys.argv[1:])
key = "YOUR-PERSONAL-API-KEY-FROM-MW"
learners = LearnersDictionary(key)
for entry in learners.lookup(query):
for ipa in entry.pronunciations:
@pfeyz
pfeyz / lemon.png
Created November 20, 2012 22:20
wxPython Flickering
lemon.png
@pfeyz
pfeyz / index.html
Created November 12, 2012 01:26 — forked from nrrb/gist:4056175
Variable Speed Stopwatch
// How often the stopwatch is actually updated
Stopwatch.interval_ms = 200;
function Stopwatch(time_offset, ratio_to_realtime, display_increment_ms, display_function) {
this.start_time = (new Date()).getTime();
if(time_offset) {
this.start_time -= time_offset;
}
this.now_time = this.start_time;