This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
// v v | |
// \\O// | |
$RED = 31; | |
$GREEN = 32; | |
$BLUE = 34; | |
$MAGENTA = 35; | |
$CYAN = 36; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Substitution with Hash (Ruby 1.9, not documented) | |
":(".gsub(/./, ':' => ';', '(' => ')') #=> ";)" | |
# The “assign first” operator | |
caterpillar_part ,= ["head", "body"] | |
caterpillar_part #=> "head" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require "terminal-notifier" | |
rescue LoadError | |
end | |
require "open-uri" | |
WHO = "whytheluckystiff.net" | |
WHAT = "http://" | |
WHERE = "/" | |
WHY = WHAT + WHO + WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Concatenates audio files together using avconv. | |
# | |
# Usage: avconcat -o <output> <inputs...> | |
# | |
output = nil | |
output_arg = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
OlderNewer