Skip to content

Instantly share code, notes, and snippets.

View harrisj's full-sized avatar

Jacob Harris harrisj

View GitHub Profile
@harrisj
harrisj / load.rb
Created January 16, 2014 21:11
Here's an example of doing yields in Ruby. The fail! and finished! methods set the state of the load in the DB and save the execution time
def self.audit(command = 'Load')
unless block_given?
raise ArgumentError, "You can only invoke audit with a block"
end
a = nil
begin
a = Load.create :command => command, :status => 'started', :start_time => Time.now
yield a
@harrisj
harrisj / toasternet.html
Created January 25, 2014 01:08
ToasterNet: a theoretical paper in which we proposed using consumer electronics to build a secret supercomputer for evil ends
<HEAD>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>Toaster Net: Design and Feasibility Analysis of a Java-Based Key Search System</h1>
<H2 ALIGN=CENTER>12/9/96</H2>
<H2 ALIGN=CENTER>Jake Harris, Katy King, Darrin Jewell</H2>
<HR>
<H2>Abstract</H2>
<P>As recent RSA factorization efforts have shown

Keybase proof

I hereby claim:

  • I am harrisj on github.
  • I am harrisj (https://keybase.io/harrisj) on keybase.
  • I have a public key whose fingerprint is E181 A3C9 F101 EE15 337E C8E5 B1F3 3CAA 5BC8 4BCC

To claim this, I am signing this object:

@harrisj
harrisj / gist:b652f80fb55b6301b4ed
Last active July 21, 2016 05:23
Slack notification for election_results
class SlackNotifier
def self.notify(load_id)
notify_first_votes(load_id)
notify_calls(load_id)
notify_runoffs(load_id)
notify_uncalls(load_id)
notify_ap_uncalls(load_id)
end
def self.notify_first_votes(load_id)
@harrisj
harrisj / reporting.csv
Created September 18, 2014 01:24
Reporting times for CA Governor Primary 2014
Report Time
POLL CLOSE 2014-06-04 03:00:00
0.09 2014-06-04 03:11:08
0.63 2014-06-04 03:14:26
3.48 2014-06-04 03:17:43
4.34 2014-06-04 03:21:06
5.33 2014-06-04 03:23:35
5.33 2014-06-04 03:26:27
5.33 2014-06-04 03:30:04
4.79 2014-06-04 03:32:56
@harrisj
harrisj / gist:4e55678aeca0bcaf3f16
Last active August 29, 2015 14:16
Georgetown Lecture

Outline for Georgetown Business Class

  • Who I am
  • Journalist's Best friends: SKEPTICISM AND PARANOIA
    • They're here to keep you from making mistakes
    • SKEPTICISM - is this data really correct?

Keybase proof

I hereby claim:

  • I am harrisj on github.
  • I am harrisj (https://keybase.io/harrisj) on keybase.
  • I have a public key whose fingerprint is 219E C44A EC5B 6425 5A5B 0CB9 22C5 DDCC 45EE 2FBA

To claim this, I am signing this object:

@harrisj
harrisj / times_machine.rb
Created April 10, 2016 01:34
My hackish Ruby script for hopping to a random NYT issue in the years 1851 - 1922 (ie, in the public domain)
#!/usr/bin/env ruby
years = (1851..1922).to_a
months = (1..12).to_a
def max_day_for_month(month, year)
case month
when 1, 3, 5, 7, 8, 10, 12
31
when 9, 4, 6, 11
@harrisj
harrisj / examples.txt
Created April 20, 2017 16:26
Adding even numbers between 1 and 100
Go
total := 0
for i := range 100 {
if i % 2 == 0 {
total = total + i
}
}
Rust
let evens = (0..100).filter(|&x| x % 2 == 0);
@harrisj
harrisj / shins_girls.txt
Last active May 7, 2017 23:56
All the times the Shins mention a girl
And she was no ordinary girl
Girl, inform me, all my senses warn me
Remember the girls in the middle are always the first to fall off.
You're the girl on the wing of a barnstormer
So forget about it, girl
I gotta leave here, my girl, get on with my lonely life
Girl, you must atone some
Eyeless in the morning sun you were pale and mild, a modern girl
You'd be damned to be one of us, girl
Dare to be one of us, girl