Skip to content

Instantly share code, notes, and snippets.

View paigeruten's full-sized avatar

Paige Ruten paigeruten

View GitHub Profile
#include <stdio.h>
#include <openssl/evp.h>
int main(void) {
unsigned char plaintext[] = "AAAAAAAAAAAAAAAA";
unsigned char key[] = "BBBBBBBBBBBBBBBB";
unsigned char iv[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
unsigned char res[32];
// Encrypting
One morning I looked out my bedroom window to see an enormous moving van parked
in front. A crew of twenty movers waited on the street for the one guy to open
the latch on the back. Once done, they immediately got to work. Desks, beds,
sofas, and chairs made their way up my sidewalk and into the front door, one by
one, one tireless mover at each end.
And on the string of deluxe handcrafted furniture flowed. It just never ended. I
lost count after 24 beds.
It was at this point that I grew suspicious. Where was mom? Why did she order
# Substitution with Hash (Ruby 1.9, not documented)
":(".gsub(/./, ':' => ';', '(' => ')') #=> ";)"
# The “assign first” operator
caterpillar_part ,= ["head", "body"]
caterpillar_part #=> "head"
@paigeruten
paigeruten / java-repl.rb
Created January 30, 2011 03:42
A very simple and rough and slow REPL for Java
# A very simple and rough and slow REPL for Java, but it's better than making a
# new Java program every time you want to test something.
class JavaREPL
def initialize(filename = "JavaREPL")
@filename = filename
reset
end
def repl
loop { java_print java_eval java_read }
@paigeruten
paigeruten / whyduel.html
Last active September 26, 2015 00:46
_why's original dueling swordsmen Javascript program, ca. 2000
<HTML>
<HEAD>
<TITLE>[why.datablocks.net] : sliding down the porcelain golf course</TITLE>
<META name="description" content="whytheluckystiff is a shoddy programmer, a fountain of convulted knowledge, exhibited in his livid liteStep themes and cursed web show. the navy has been asked to monitor things. they will not, so the traffic coming and going will exclaim 'My God! What is it now?' as each release of some strange product comes out fractured and unwarranted. he is a thief of code, a guilty poser.">
<META name="keywords" content="evil, poor, shifty, catalyst to fine thinking, uncouth, unwell, bad, very bad to the hilt, should be underneath something - anything">
<SCRIPT LANGUAGE="Javascript">
eval(unescape('%69%66%20%28%74%6F%70%2E%66%72%61%6D%65%73%2E%6C%65%6E%67%74%68%21%3D%30%29%0D%0A%74%6F%70%2E%6C%6F%63%61%74%69%6F%6E%3D%73%65%6C%66%2E%64%6F%63%75%6D%65%6E%74%2E%6C%6F%63%61%74%69%6F%6E%3B'));
// BEGIN DHTML FUNCTIONALITY - DO NOT TOUCH
var manTrance = 0;
var manDir = 0;
#lang plai
;; Recursion (via special environments)
;; Procedures (lexical)
;; Conditionals
;; With (via Lexical Environments)
;; and Arithmetic Expressions and Primitives
;; LAZY-EVALUATION
@paigeruten
paigeruten / why-daemon.rb
Created January 6, 2013 20:46
take a snapshot of whytheluckystiff.net whenever it updates
begin
require "terminal-notifier"
rescue LoadError
end
require "open-uri"
WHO = "whytheluckystiff.net"
WHAT = "http://"
WHERE = "/"
WHY = WHAT + WHO + WHERE
# whyspooler.rb
# mostly a translation of _why's OCaml script to Ruby
#
# polls whytheluckystiff.net for new printouts, converts to pdf, saves them into ./SPOOL, and prints them
#
# usage: `ruby whyspooler.rb http://whytheluckystiff.net`
#
# OS X install instructions:
# 1. `gem install open4`
# 2. download MacPCLtoPDF.zip from http://www.columbia.edu/~em36/pcltopdf.html
@paigeruten
paigeruten / rit.rb
Last active December 19, 2015 18:18
play an audio file at a particular speed
#!/usr/bin/env ruby
# rit.rb - play an audio file at a particular speed
#
# usage: ruby rit.rb <speed> <path_to_audio_file>
#
# <speed> is a float which acts as a multiplier. 1.0 is normal speed, 2.0
# is double speed, 0.5 is half speed, and so on.
#
# put 0 for <speed> for a fun easter egg.
@paigeruten
paigeruten / alarm.rb
Created October 30, 2013 05:09
a simple command line alarm clock, I use it to play some music when the alarm goes off.
#!/usr/bin/ruby
#
# Usage: ruby alarm.rb <time>
#
# <time> is either a number of seconds (e.g. "50"), minutes and seconds
# (e.g. "5:30"), or hours minutes and seconds (e.g. "7:30:00"). After the
# specified amount of time has passed, ring_alarm will be called and the
# program will exit.
#