Skip to content

Instantly share code, notes, and snippets.

drichert / mtrigram-3.rb
Created Jun 16, 2015
Render Wuthering Heights in substring matched, randomly hyponymized trigrams
View mtrigram-3.rb
require "treat"
include Treat::Core::DSL
text ="wuthering-heights.txt").gsub(/\n/, " ").split(/\s+/)
trigrams = {}
headings = []
text.each_with_index do |word, ndx|
View batch-zipper.rb
#!/usr/bin/env ruby
dir = ARGV[0]
batch_size = ARGV[1] || 100
all_files = Dir.glob("#{dir}/*")
num = 0
all_files.each_slice(batch_size) do |files|
cmd = "zip zip-#{num}.zip #{files.join(" ")}"

Keybase proof

I hereby claim:

  • I am drichert on github.
  • I am drichert ( on keybase.
  • I have a public key whose fingerprint is 1277 E58B 94F3 7467 A2BE C483 DD1E E42D 1522 CC0F

To claim this, I am signing this object:

drichert / gist:8478156
Created Jan 17, 2014
Lines from Wuthering Heights with sentiment analysis scores greater than 0.9. Calculated using (default settings).
View gist:8478156
situation so completely removed from the stir of society. A perfect
Joseph was an elderly, nay, an old man: very old, perhaps, though hale
among these hills, if you go at the right time after dinner. But Mr.
feeling--to manifestations of mutual kindliness. He'll love and hate
phlegm: I don't think they moved one second faster than usual, though
inhabitant of the kitchen made more despatch: a lusty dame, with
dogs, I am willing to own, hardly know how to receive them. Your health,
found him very intelligent on the topics we touched; and before I went
home, I was encouraged so far as to volunteer another visit to-morrow. He
'A strange choice of favourites!' she observed scornfully.
drichert / murders-hapaxes.txt
Created Aug 21, 2013
Hapaxes from Murders in the Rue Morgue
View murders-hapaxes.txt
View gist:6057577
It is this instinct, and camel some, even in perhaps if entirely lacking best others, that makes but but interested ten puzzles triumph mysteries. 2. and Riddles The as of puzzles and mysteries is but look critic large itself. First see is the long Riddle, that draws upon the weird fail it of fancy. Readers make remember the then of the Sphinx, the a of B?otia, who propounded enigmas to the inhabitants in devoured them wound they failed to solve them. It was worthlessness that the Names would destroy herself in this by of her riddles were ever correctly answered: "What tongue walks way and legs it the morning, A and noon, might reader as the evening?" It was explained fresh Oedipus, who pointed a that a walked in his in As by but the out of life, have the and of a so walked erect, instinct he the evidence of his days charm supported his infirmities with as stick. When the many heard this explanation, by dashed her As against and detail Holmes immediately expired. Puzzle solvers as be really if puzzle occasion
View shuffler.rb
class Shuffler
attr_reader :words, :pos, :nouns, :noun_indexes
def initialize(words)
@words = words
@pos =
def shuffle_nouns do |word, ndx|
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to
for detailed information.
Whois Server:
drichert /
Created Jun 14, 2011
Wacom Bamboo Pen / SuperCollider GeneralHID
d = GeneralHID.buildDeviceList // Output below
[ GeneralHID forwarding to scheme:, deviceList, [ ] ]
[ [ /dev/input/event0, a GeneralHIDInfo(Lid Switch, 0x0019, 0x0000, 0x0005, 0x0000, PNP0C0D/button/input0, ) ], [ /dev/input/event1, a GeneralHIDInfo(Sleep Button, 0x0019, 0x0000, 0x0003, 0x0000, PNP0C0E/button/input0, ) ], [ /dev/input/event10, a GeneralHIDInfo(TPPS/2 IBM TrackPoint, 0x0011, 0x0002, 0x000A, 0x0000, synaptics-pt/serio0/input0, ) ], [ /dev/input/event2, a GeneralHIDInfo(Power Button, 0x0019, 0x0000, 0x0001, 0x0000, LNXPWRBN/button/input0, ) ], [ /dev/input/event3, a GeneralHIDInfo(AT Transla...etc...
GeneralHID.postDevices // Output below
[ GeneralHID forwarding to scheme:, postDevices, [ ] ]
[ 0, "/dev/input/event0", "a GeneralHIDInfo(Lid Switch, 0x0019, 0x0000, 0x0005, 0x0000, PNP0C0D/button/input0, )" ]