Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'optparse'
require 'rubygems'
require 'meow'
def usage!
puts $opt
exit
end
#!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)
# coding: utf-8
require 'pp'
require 'fileutils'
require 'mechanize'
require 'is_lisp.rb'
module Lispka
Source = Struct.new(:text, :is_lisp)
class SRFI
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}
}
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}
@yhara
yhara / wonderscm-template.rb
Created April 17, 2009 15:33
the rails template which I did *not* use
# 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
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)
*---------------------- HEADER FIELD
#PLAYER 3
#GENRE synth techno
#TITLE Endeavor(DP NORMAL v1)
#ARTIST ZUN(Arr.sun3)
#BPM 165
#PLAYLEVEL 10
#RANK 3
#TOTAL 450
#!/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
#!/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