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 | |
# -*- coding: utf-8 -*- | |
# Primitive NoteFactory. | |
# http://en.wikipedia.org/wiki/Piano_key_frequencies | |
T = 44000 | |
class NoteFactory | |
attr_accessor :notes, :notes_in_octave |
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 | |
T = 50000 | |
def n | |
rand(6) + 1 | |
end | |
def title(x) | |
puts x | |
puts "*" * x.length |
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 | |
# encoding: utf-8 | |
require 'nokogiri' | |
require 'pry' | |
def wrap(title, content) | |
<<-TEMPLATE | |
<!DOCTYPE html> | |
<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 | |
require 'matrix' | |
module Drawing | |
ZOOM = 0.5 | |
SCALE = 40 | |
def clear | |
@@clear ||= %x{clear} |
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 <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#define SHMLEN sizeof(int) * 2 | |
#define TIMES 30 |
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 | |
require 'rubygems' | |
require 'pry' | |
require 'nokogiri' | |
require 'mini_magick' | |
require 'digest' | |
W = 412 | |
H = 600 |
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
#!/bin/zsh | |
surl="http://www.reddit.com/r/jazz/search?q=%s&restrict_sr=on&sort=relevance&t=all" | |
url="http://www.reddit.com/r/jazz/" | |
find() { | |
curl -s $1 | ack -o "https?://(www.)?youtu[^'\"&]+" | |
} | |
parse() { |
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
r() { | |
if [ -z "$1" ]; then | |
rails | |
return | |
fi | |
case "$1" in | |
start) | |
shift | |
rails s -d "$@" |
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 | |
$, = ' ' | |
class Digits | |
RAW = [ | |
" 111 ", | |
"4 2", | |
"4 2", | |
" 333 ", |
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
importize = (mixin, module) -> | |
$.extend($.extend({}, mixin), module) |
OlderNewer