https://github.com/ledermann/unread
全体像
├── .gemtags
├── .gitignore
├── .tags
├── .tags_sorted_by_file
├── .travis.yml
class ProducerConsumer | |
KILL = :kill | |
def initialize(produce:, consume:, producer_num: 1, consumer_num: 5, max_queue_size: 1000) | |
@produce = produce | |
@consume = consume | |
@consumer_num = consumer_num | |
@producer_num = producer_num | |
@ids_index = 0 | |
@max_queue_size = max_queue_size |
# バックナンバー | |
### Rubyわくわくナビ | |
- 2012-66:Bundlerを使いこなす! | |
- 2012-67:厳選!用途別Ruby/Railsライブラリツール | |
- 2012-68:データで見るRubyGemsの世界 | |
### 一歩先をゆくRuby |
504b 0304 1400 0000 0000 ed60 3a48 615b | |
d117 3e03 0000 3e03 0000 1600 0000 436f | |
6d6d 656e 7473 2e74 6d50 7265 6665 7265 | |
6e63 6573 3c3f 786d 6c20 7665 7273 696f | |
6e3d 2231 2e30 2220 656e 636f 6469 6e67 | |
3d22 5554 462d 3822 3f3e 0a3c 2144 4f43 | |
5459 5045 2070 6c69 7374 2050 5542 4c49 | |
4320 222d 2f2f 4170 706c 6520 436f 6d70 | |
7574 6572 2f2f 4454 4420 504c 4953 5420 | |
312e 302f 2f45 4e22 2022 6874 7470 3a2f |
#!/usr/bin/env bash | |
# 参考サイト: http://tukaikta.blog135.fc2.com/blog-entry-224.html | |
# ================各種設定================ | |
# ダウンロードするファイル (GNU 日本語man) | |
# | |
# http://linuxjm.sourceforge.jp/ からダウンロードするファイルを指定します。 | |
#export GNUJMAN=man-pages-ja-20120915.tar.gz | |
#export GNUJMAN=man-pages-ja-20150315.tar.gz |
// 環境 node v4.1.2 | |
// 実行せず出力結果を記述しなさい | |
console.log(typeof 'foo'); | |
console.log(typeof new Object()); | |
console.log(typeof undefined); | |
console.log(typeof new Function('x', 'y', 'return x * y')); | |
console.log(typeof true); | |
console.log(typeof /abc/g); | |
console.log(typeof String('hoge')); | |
console.log(typeof 10); |
https://github.com/ledermann/unread
全体像
├── .gemtags
├── .gitignore
├── .tags
├── .tags_sorted_by_file
├── .travis.yml
[1] pry(main)> class Base | |
[1] pry(main)* cattr_accessor :setting2 | |
[1] pry(main)* end | |
=> [:setting2] | |
[2] pry(main)> class Subclass < Base ; end | |
=> nil | |
[3] pry(main)> Base.setting2 | |
=> nil | |
[4] pry(main)> Base.setting2 = true |
(User.hoges || []).each do |hoge| | |
hoge.fuga! | |
end |
class MutableConstant | |
SERVICE_TYPES1 = ["basic", "premium", "pro"] | |
SERVICE_TYPES2 = ["basic", "premium", "pro"].freeze | |
SERVICE_TYPES3 = ["basic", "premium", "pro"].map(&:freeze).freeze | |
module Defaults | |
SERVICE_TYPES1 = ["basic", "premium", "pro"] | |
SERVICE_TYPES2 = ["basic", "premium", "pro"].freeze | |
SERVICE_TYPES3 = ["basic", "premium", "pro"].map(&:freeze).freeze | |
end |
#!/usr/bin/env ruby | |
require "webrick" | |
=begin | |
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby. | |
It comes with most installations of Ruby by default (it’s part of the standard library), | |
so you can usually create a basic web/HTTP server with only several lines of code. | |
The following code creates a generic WEBrick server on the local machine on port 1234, |