Skip to content

Instantly share code, notes, and snippets.

View urschrei's full-sized avatar
💭
🌒

Stephan Hügel urschrei

💭
🌒
View GitHub Profile
@urschrei
urschrei / horror.py
Created September 8, 2019 14:36 — forked from sbma44/horror.py
Lovecraft word pairs by rarity of vocab
# sample invocation:
# pdftotext -f 5 /tmp/The_Complete_Works_of_H.P._Lovecraft.pdf - | python3 horror.py | uniq > lovecraft_word_pairs_sorted.txt
import re
import sys
import nltk
import wordfreq
re_word = re.compile(r'[^\-\w]')
@urschrei
urschrei / playground.rs
Last active February 2, 2016 09:59 — forked from anonymous/playground.rs
Threaded send/receive using channels in Rust
use std::thread;
use std::sync::mpsc::{ channel, Sender };
enum Wrapped {
A(f64),
B(f64),
}
fn produce_a(sender: Sender<Wrapped>) {
for i in 0 .. 5 {
@urschrei
urschrei / jenks2.py
Created September 22, 2013 00:28 — forked from llimllib/jenks2.py
import json
from pprint import pprint as pp
def jenks_matrices_init(data, n_classes):
#fill the matrices with data+1 arrays of n_classes 0s
lower_class_limits = []
variance_combinations = []
for i in xrange(0, len(data)+1):
temp1 = []
temp2 = []
@urschrei
urschrei / gist:2917499
Created June 12, 2012 13:26
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after