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 'optparse' | |
require 'rubygems' | |
require 'meow' | |
def usage! | |
puts $opt | |
exit | |
end | |
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
#!r6rs | |
; based on http://lucille.atso-net.jp/aobench/ | |
;(import (rnrs) (srfi :8) (srfi :27)) | |
(use srfi-8) | |
(use srfi-27) | |
(define open-file-output-port open-output-file) | |
(define close-port close-output-port) | |
(define exact inexact->exact) |
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
# coding: utf-8 | |
require 'pp' | |
require 'fileutils' | |
require 'mechanize' | |
require 'is_lisp.rb' | |
module Lispka | |
Source = Struct.new(:text, :is_lisp) | |
class SRFI |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'pstore' | |
require 'open-uri' | |
IMG_DIR = "images/" | |
def download(url, fname) | |
File.open("#{IMG_DIR}#{fname}", "w"){|f| | |
f.write open(url){|i| i.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
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb | |
index ee30e53..20ec433 100644 | |
--- a/spec/controllers/sessions_controller_spec.rb | |
+++ b/spec/controllers/sessions_controller_spec.rb | |
@@ -105,7 +105,7 @@ describe SessionsController do | |
route_for(:controller => 'sessions', :action => 'new').should == "/login" | |
end | |
it "should route the create sessions correctly" do | |
- route_for(:controller => 'sessions', :action => 'create').should == "/session" | |
+ route_for(:controller => 'sessions', :action => 'create').should == {:path => "/session", :method => :post} |
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
# Copy database.yml | |
run "cp config/database.yml config/database.sample.yml" | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm -r test" | |
# Set up git | |
git :init |
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
require 'kconv' | |
def title_of(path) | |
case path | |
when /\d\d-(.*)\.mp3/, /\d\d_(.*)\.mp3/, /\d\d(.*)\.mp3/ | |
$1.tosjis | |
else | |
raise path | |
end | |
end | |
def tag!(files, is_dry, album=nil) |
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
*---------------------- HEADER FIELD | |
#PLAYER 3 | |
#GENRE synth techno | |
#TITLE Endeavor(DP NORMAL v1) | |
#ARTIST ZUN(Arr.sun3) | |
#BPM 165 | |
#PLAYLEVEL 10 | |
#RANK 3 | |
#TOTAL 450 |
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/sh | |
if [ "$1" == "" ]; then | |
echo "usage: gemi gemname [gem-options]" | |
exit | |
fi | |
echo "------------------ installing for ruby1.8" | |
sudo gem install $* | |
echo "------------------ installing for ruby1.9" | |
gem-1.9 install $* --format-executable |
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 | |
def list_methods(ruby, klass_name, visibility) | |
src = "p #{klass_name}.#{visibility}_methods(false).map{|m| m.to_s}.sort" | |
eval(`#{ruby} -e '#{src}'`) | |
end | |
def widen(str, width) | |
"%-#{width}s" % str | |
end |