Skip to content

Instantly share code, notes, and snippets.

View nrrb's full-sized avatar
🐦‍⬛
Unhinged Crow Content

Nicholas Bennett nrrb

🐦‍⬛
Unhinged Crow Content
View GitHub Profile
@nrrb
nrrb / AutoHotkey.txt
Created October 17, 2013 00:29
This is an AutoHotkey script to save the page currently viewed in Google Chrome in a particular folder in my Documents, giving it a filename of the URL stripped of characters that can't go in filenames, all triggered by either the F1 key or my middle mouse button. I think for the future, I'll have it trigger on one of the extra buttons on my mou…
MButton::F1
F1::
; Clear clipboard
clipboard =
; In Google Chrome, this selects the URL in the address bar
Send ^l
; Copy the URL into the clipboard
@nrrb
nrrb / summary.csv
Last active December 25, 2015 13:39
Word Frequency Analysis on 50 Shades of Grey Trilogy
Number of unique words per book
50 Shades of Grey 9427
50 Shades Darker 9585
50 Shades Freed 10959
Some interesting word counts
murmurs count murmurs rank murmur count murmur rank fuck count fuck rank shit count shit rank cow count cow rank
@nrrb
nrrb / sirdspos.asm
Last active November 30, 2019 06:20
185 byte x86 assembly code to create a stereogram of text.
; SIRDS Piece Of Shiite
; by danslemur ([email protected])
; for EFnet #asm compo 7 - Make a 256 byte intro for 386/486 class PC's
;
; I got bored and didn't fill in the whole 256 bytes. It's 185 bytes now. Eh!
;
; Thanks to:
; - Razzia for his helpful size optimization post on www.movnet.org/forum,
; - matja for showing me a better way to write a 4x4 block to the buffer,
; - Consub/CSB for the source to his Chaos demo which I borrowed the pseudo-
@nrrb
nrrb / README.md
Last active December 23, 2015 00:09 — forked from mbostock/.block
term "screen-256color"
startup_message off
caption string "%?%F%{= Bk}%? %C%A %D %d-%m-%Y %{= kB} %t%= %?%F%{= Bk}%:%{= wk}%? %n "
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
@nrrb
nrrb / CLRDownload.md
Last active December 21, 2015 09:08
CLR Podcast Downloader

This downloads the CLR podcasts (http://clr.net/media.pl) using grep and wget. The '--no-clobber' switch for wget prevents it from re-downloading previously retrieved podcasts.

# Author: Cifro Nix, http://about.me/Cifro
#
# usage:
# ./create-thumbnails.sh
# will produce thumbnails with name "<id>.jpg" with size 220x122
#
# different size:
# ./create-thumbnails.sh 640x360 -big
# will produce thumbnails with name "<id>-big.jpg" with size 640x360
@nrrb
nrrb / README.md
Created December 13, 2012 05:44 — forked from mbostock/.block
@@                                       oooo   ooo
@@                                      $   $  $   $
@@                                      "o  $ $  o""
@@                                        o  "   "ooooo
@@                                    oo ""           o$
@@                      o            o            oo  "
@@                     $$             $o$""$o  ooo$
@@                     $"$          o $    "$  $
@@           o$o       $ "$         $ $     $ $

@@ $$$o $$ "$ o$ $ o $o

'''
Hi Nick,
In original chat logs, for example, for session 1, we have data for PR like the below:
[12/5/2011 4:03:26 PM] *** Call to Field Specialist Phantom, duration 03:02. ***
[12/5/2011 4:08:39 PM] *** Call to Field Specialist Phantom, no answer. ***
Field Specialist Phantom is on another call. Please try to call again later. Thank you!
[12/5/2011 4:08:41 PM] *** Call to Field Specialist Phantom, no answer. ***
Field Specialist Phantom is on another call. Please try to call again later. Thank you!
from collections import defaultdict as dd
import csv
with open('c:/users/nick/downloads/Shalinee_edge_list_compact.csv', 'rb') as f:
rows = list(csv.DictReader(f))
# The list of unique respondent names is the same as the list of
# unique target names
names = sorted(list(set([row['respondent_name'] for row in rows])))
name_to_email = dict()