I hereby claim:
- I am wildjcrt on github.
- I am wildjcrt (https://keybase.io/wildjcrt) on keybase.
- I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }
To claim this, I am signing this object:
| x = ['男性', '男人', '兒子', '男孩', '父親', '爺爺', '叔叔', '丈夫', '女兒', '婦女', '女性', '奶奶', '女孩', '阿姨', '妻子', '母親'].shuffle | |
| y = ['音樂', '人類學', '哲學', '英語', '歷史', '文學', '藝術', '數學', '工程學', '物理學', '地質學', '化學', '天文學', '生物學'].shuffle | |
| result = [] | |
| y.each_with_index do |ey, i| | |
| result << "#{x[i]}#{ey}" | |
| end | |
| result |
| require 'benchmark/ips' | |
| require 'date' | |
| Benchmark.ips do |x| | |
| x.time = 100 | |
| x.report('Time') do | |
| Time.now.year | |
| end |
I hereby claim:
To claim this, I am signing this object:
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| Akira | |
| https://speakerdeck.com/a_matsuda/render-it-a-deep-dive-into-actionview-and-template-engines | |
| Prem | |
| https://speakerdeck.com/sikachu/zero-downtime-payment-platforms-1 | |
| Shibata | |
| https://speakerdeck.com/hsbt/crafting-rails-culture | |
| 葉叮叮 |
| >> a = [1, 2, 3, 4, 5, 1, 2] | |
| => [1, 2, 3, 4, 5, 1, 2] | |
| >> a.compact.size | |
| => 5 | |
| >> a.compact!.size | |
| NoMethodError: undefined method `size' for nil:NilClass | |
| from (irb):14 | |
| from /Users/wildjcrt/.rvm/rubies/ruby-2.1.3/bin/irb:11:in `<main>' |
以下內容 copy 自 https://railstaiwan.hackpad.com/Rails-Outreach-Workshop-Taipei-01--PBrwnbjqMx3#:h=要先用隨身碟準備安裝程式
隨身碟裡面灌這些東西:
| sql = "select *, (select count(books.id) from books where books.authorsid=authors.id) as books_count from authors " | |
| authors = Author.find_by_sql(sql) | |
| authors.first.books_count |
| desc "Pings PING_URL to keep a heroku dyno alive" | |
| task :dyno_ping do | |
| require "net/http" | |
| if ENV['PING_URL'] | |
| uri = URI(ENV['PING_URL']) | |
| Net::HTTP.get_response(uri) | |
| end | |
| end |
| hash = { | |
| :carol => 'cancer', | |
| :jaince => 'taurus', | |
| :ting => 'twines', | |
| :jerry => 'cancer' | |
| } | |
| ratings = Hash.new(0) | |
| hash.values.each {|rate| ratings[rate] += 1} |