Just Performed Remote Development Container - Open Directory
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Table | |
attr_reader :header, :rows | |
def initialize(header, rows) | |
@header = header | |
@rows = rows | |
end | |
end | |
class Row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_first_and_last_letters(str) | |
return '' if str.length <= 2 | |
str[1..-2] | |
end | |
puts remove_first_and_last_letters('foo') | |
puts remove_first_and_last_letters('hi') | |
puts remove_first_and_last_letters('x') | |
puts remove_first_and_last_letters('xHello, world!D') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chpid = Process.fork do | |
10.times do | |
STDOUT.puts "Foo" | |
sleep 1 | |
end | |
end | |
puts "Child process started" | |
Process.waitpid(chpid) | |
puts "End" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exampleValues = [2, 15, 8, 23, 1, 32]; | |
const result = exampleValues.reduce(({truthyValues, falseyValues}, exampleValue) => { | |
if (exampleValue > 10) { | |
truthyValues.push(exampleValue); | |
return { truthyValues, falseyValues }; | |
} | |
falseyValues.push(exampleValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Person struct { | |
Name string | |
} | |
func (p Person) Greeting() string { | |
return fmt.Sprintf("Hello, %v!", p.Name) |
作りたいものリスト。
- 勉強会などで特定のハッシュタグで連続してツイートしやすいTwitterクライアント
- 勉強会で指定されたタグを一度入力したら、あとは思ったことをtsudaるだけ、にしたい。
- 勉強会主催者が、予めハッシュタグを固定した投稿ページのURLを作って公開できるとタグの間違いが減りそう。
- 勉強会の告知サイトに掲載できるとよさげ。
- stringカラムが期待したURLかどうかをチェックするrailsのvalidator
- 既にある https://github.com/perfectline/validates_url
- 真偽値 bool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func Screaming(names <-chan string, control <-chan bool) { | |
ticker := time.Tick(500 * time.Millisecond) | |
for { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
// 1. | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. |