Skip to content

Instantly share code, notes, and snippets.

View alyssa's full-sized avatar

Alyssa Pohahau alyssa

View GitHub Profile
@alyssa
alyssa / sonic_pi_so_what.rb
Last active August 26, 2015 06:12
bass line from Miles Davis' "So What"
# beats per minute
use_bpm 140
# Choose a root note (one) and everything else will fall into place.
one = :D2
# Groove: quarter note triplets (trip-uh-let, trip-uh-let, ...)
trip_uh = 0.6666
let = 0.3333
@alyssa
alyssa / sonic_pi_feeling_blue.rb
Last active July 9, 2022 15:58
Standard 12 bar blues (bass line + comping) for sonic pi (sonic-pi.net)
# Standard 12 bar blues
# I7 | IV7 | I7 | I7
# IV7 | IV7 | I7 | I7
# V7 | IV7 | I7 | I7
# Choose a root note (one) and everything else will fall into place.
one = :G2
four = one + 5
five = one + 7
$ curl http://127.0.0.1:5000/phishes/30/notes
[
{
"created_at": "1159818029",
"flag_type": "falsepos",
"follow_up": "n",
"message": "This is actually a link to the real PayPal.com site!",
"modified_at": "1159821321",
"note_id": 18,
"phish_id": 30,
@alyssa
alyssa / gist:4423720
Created December 31, 2012 23:09
Top CS schools in a ruby array
top_cs_schools = ["Carnegie Mellon University", "Massachusetts Institute of Technology", "Stanford University", "University of California--Berkeley", "Cornell University", "University of Illinois--Urbana-Champaign", "University of Washington", "Princeton University", "University of Texas--Austin", "Georgia Institute of Technology", "California Institute of Technology", "University of Wisconsin--Madison", "University of Michigan--Ann Arbor", "University of California--Los Angeles", "University of California--San Diego", "University of Maryland--College Park", "Columbia University", "Harvard University", "University of Pennsylvania", "Brown University", "Purdue University--West Lafayette", "Rice University", "University of Massachusetts--Amherst", "University of North Carolina--Chapel Hill", "University of Southern California", "Yale University", "Duke University", "Johns Hopkins University", "New York University", "Ohio State University", "Pennsylvania State University--University Park", "Rutgers, the State Un
@alyssa
alyssa / prestige.py
Created November 20, 2012 01:13
prestige algorithm
do until l no change (p, p'):
p = p'
p' = vector or 0's
for v in v -> u: # do for all u
p'[u] += p[v]
p' = p' / ||p'|| # ||p'|| is the magnitude of p'