Skip to content

Instantly share code, notes, and snippets.

desc 'Hello World'
task :hello_world do
puts "Hello World"
end
Potentially a bit buggy. I think the Kanji actually includes some Korean, but it's worked most of the time.
KANJI= Regexp.new('[一-]')
HIRAGANA= Regexp.new('[ぁ-ゞ]+')
KATAKANA= Regexp.new('[゠-ヾ]+')
MULTI_KANJI= Regexp.new('[一-]+')
KANJI_AND_HIRAGANA= Regexp.new('[一-]+[ぁ-ゞ]*')
一右雨円王音下火花学気九休金空月犬見五口校左三山子四糸字耳七車手十出女小上森人水正生青夕石赤千川先早足村大男中虫町天田土二日入年白八百文木本名目立力林六引雲遠何科夏家歌画回会海絵貝外間顔汽記帰牛魚京強教玉近形計元原戸古午後語工広交光考行高黄合谷国黒今才作算止市思紙寺自時室社弱首秋春書少場色食心新親図数西声星晴切雪船前組走草多太体台地池知竹茶昼長鳥朝通弟店点電刀冬当東答頭同道読南馬売買麦半番父風分聞米歩母方北毎妹明鳴毛門夜野友用曜来楽里理話悪安暗医意育員院飲運泳駅園横屋温化荷界開階角活寒感館岸岩起期客究急級宮球去橋業曲局銀苦具君兄係軽血決研県言庫湖公向幸港号根祭細仕死使始指歯詩次事持式実写者主守取酒受州拾終習週集住重所暑助昭消商章勝乗植申身神深進世整線全送息族他打対待代第題炭短着注柱丁帳調直追定庭鉄転都度投島湯登等動童内肉農波配畑発反坂板皮悲美鼻氷表秒病品負部服福物平返勉放万味命面問役薬由油有遊予洋葉陽様落流旅両緑礼列路和愛案以衣位囲委胃印英栄塩央億加貨課芽改械害各覚完官漢管関観願希季紀喜旗器機議求救給挙漁共協鏡競極区軍郡型景芸欠結建健験固功候航康告差菜最材昨刷殺察参産散残士氏史司姉試辞失借種周宿順初唱焼照賞臣信真成省清勢静席積折節説浅戦選然争相倉想象速側続卒孫帯隊達単談治置貯腸低底停的典伝徒努灯堂働毒熱念敗倍博飯飛費必筆票標不夫付府副粉兵別辺変便包法望牧末満脈民約勇要養浴利陸良料量輪類令冷例歴連練老労録圧移因永営衛易益液演応往恩仮価果河過賀快解格確額刊幹慣歓眼基寄規技義逆久旧居許境興均禁句訓群経潔件券険検絹限現減故個護効厚耕鉱構講混査再災妻採際在財罪雑蚕酸賛支志師資示似児識質舎謝授収修衆祝述術準序除招承称証条状常情織職制性政精製税責績接設舌絶銭善祖素総造像増則測属損退貸態団断築張提程適敵統銅導特得徳独任燃能破犯判版比肥非備俵評貧布婦富武復複仏編弁保墓報豊防貿暴未務無迷綿輸余預容率略留領異遺域壱宇羽映延沿可我灰街拡革閣割株干巻看勧簡丸危机揮貴疑弓吸泣供胸郷勤筋系径敬警劇穴兼権憲源厳己呼誤后好孝皇紅降鋼刻穀骨困砂座済裁策冊至私姿視詞誌磁射捨尺釈若需樹宗就従縦縮熟純処署諸将笑傷障城蒸針仁垂推寸是聖誠宣専泉洗染奏窓創層操蔵臓俗存尊宅担探段暖値仲宙忠著庁兆頂潮賃痛展討党糖届難弐乳認納脳派拝背肺俳班晩否批秘腹奮陛閉片補宝訪亡忘棒枚幕密盟模矢訳郵優幼羊欲翌乱卵覧裏律臨朗論亜哀握扱依威為尉偉違維慰緯逸芋姻陰隠韻詠影鋭疫悦越謁閲炎
Ripped off from:
http://ask.metafilter.com/87956/Please-help-me-make-my-terminal-work
on run argv
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down -- open a new tab
tell application "Terminal" to do script "cd " & item 1 of argv in front window -- change directory
end run
Save this script as /Users/[username]/scripts/newtab.scpt
require 'rubygems'
require 'wirble'
require 'pp'
Wirble.init
Wirble.colorize
class Object
def local_methods(regex = nil)
(methods - Object.instance_methods).grep(/#{regex}/).sort
class AddAvatarColumnsToMember < ActiveRecord::Migration
def self.up
add_column :members, :avatar_file_name, :string
add_column :members, :avatar_content_type, :string
add_column :members, :avatar_file_size, :integer
add_column :members, :avatar_updated_at, :datetime
end
def self.down
remove_column :members, :avatar_file_name
Everything (mostly) with leonardchin is a translation from the talk:
[00:33] == evan_ [i=cad16a05@gateway/web/freenode/x-a4e8255f59ce2a47] has joined #rubykaigi1
[00:33] == kitaj changed the topic of #RubyKaigi1 to: 一橋記念講堂 / Hall - 基調講演 by Matz
[00:33] == erukiti [i=cad16a05@gateway/web/freenode/x-da476d33511bba0e] has joined #rubykaigi1
[00:33] <n0kada> 鳥取の左から
[00:33] == miau [i=7cd30545@gateway/web/freenode/x-9de4c69808fd4d56] has joined #rubykaigi1
[00:33] <leonardchin> works at NaCL & Rakuten
[00:33] <leonardchin> So, Change
[00:33] == nodat [i=cad16a05@gateway/web/freenode/x-9a824550e29e3a4c] has quit [Ping timeout: 180 seconds]
:( I miss you Ruby...
>>> x = 7
>>> print x + "some literal"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
>>> x.to_string()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Problem:
pg_hba.conf:
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
pg_ident.conf:
(blank, just comments)
The rake tasks with Jeweler
rake -T
rake build # Build gem
rake check_dependencies # Check that runtime and development dependencies are installed
rake check_dependencies:development # Check that development dependencies are installed
rake check_dependencies:runtime # Check that runtime dependencies are installed
rake clobber_rdoc # Remove rdoc products
rake clobber_spec:rcov # Remove rcov products for spec:rcov
rake gemcutter:release # Release gem to Gemcutter
rake gemspec # Generate and validates gemspec