Skip to content

Instantly share code, notes, and snippets.

# Class methods
YAML.load()
YAML::load()
# Array and Hash
array = Array.new
array = []
hash = Hash.new
hash = {}
@takaaki
takaaki / genre_list.rb
Created December 9, 2008 04:22
ID3 tags
# Goodies from Lowell
GENRE = [ "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk",
"Grunge","Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other",
"Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial",
"Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack",
"Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion",
"Trance", "Classical", "Instrumental", "Acid", "House", "Game",
"Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", "Soul",
"Punk", "Space", "Meditative", "Instrumental Pop",
@takaaki
takaaki / genre.yaml
Created December 9, 2008 19:51
ID3 tags
---
- Blues
- Classic Rock
- Country
- Dance
- Disco
- Funk
- Grunge
- Hip-Hop
- Jazz

Certifications

  • Ruby Silver Certification
  • MySQL Developer Certification
  • Zend PHP Certification
  • UML Fundamental
  • Oracle Bronze/Silver if I apply for System Integrators.

Others

require "rubygems"
require 'mechanize'
agent = WWW::Mechanize.new
response = agent.get("http://twitter.com/statuses/user_timeline/samuraicoder.xml")
xml = response.content
doc = Nokogiri::XML(xml)
doc.search("text").each do |text|
p text.inner_html
end
# Stolen from http://vimeo.com/369095
# configファイルをリリースパスへ移す。
# GitやSubversionにdatabase.ymlやconfig.ymlをignoreさせて
# 設定ファイルがたくさんの人に見られてしまうのを避ける。
# 実際にデプロイする前には、"scp"でローカルからWebサーバーの"#{shared_path}/config/"まで
# 手動で移す。
task :update_config, :roles => [:app] do
run "cp -Rf #{shared_path}/config/* #{release_path}/config"
# Add this for Rails projects to make the "maintenance" mode work.
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Add this for Rails projects to make the "maintenance" mode work.
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
sinatra_programs % git init
Initialized empty Git repository in /Users/takaaki/repos/sinatra_programs/.git/
sinatra_programs % git add .
sinatra_programs % git ci -m "Initial commit"
Created initial commit 3b18ec3: Initial commit
2 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 config.ru
create mode 100644 myapp.rb
sinatra_programs(master) % heroku create --remote
Created http://high-mountain-16.heroku.com/ | git@heroku.com:high-mountain-16.git
ALABAMA AL
ALASKA AK
AMERICAN SAMOA AS
ARIZONA AZ
ARKANSAS AR
CALIFORNIA CA
COLORADO CO
CONNECTICUT CT
DELAWARE DE
DISTRICT OF COLUMBIA DC