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
require File.expand_path('../boot', __FILE__) | |
# Pick the frameworks you want: | |
require "active_record/railtie" | |
require "action_controller/railtie" | |
require "action_mailer/railtie" | |
require "sprockets/railtie" | |
# require "rails/test_unit/railtie" | |
# Require the gems listed in Gemfile, including any gems |
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
# wait_for_content 'Submit' | |
# wait_for_content 'Submit', selector: '.super-button' | |
# wait_for_content 'Submit', selector: 'form .super-button' | |
# wait_for_content 'Message', timeout_s: 5 | |
# wait_for_content 'Messages?', timeout_s: 5 | |
# wait_for_content '[ck]lass(es)?' | |
# wait_for_content 'Thanks' do | |
# puts 'Waiting...' | |
# 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
# How to pass value to a class that generated by Class.new in ruby | |
# ruby で Class.new で生成した class に値を渡す方法 | |
def ClassTemplate(name) | |
Class.new do |klass| | |
klass.instance_variable_set :@my_name, name | |
def hello | |
puts "Hello, #{self.class.instance_variable_get(:@my_name)}!" | |
end | |
end | |
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
// https://go-tour-jp.appspot.com/moretypes/18 | |
package main | |
import "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for y, _ := range pic { | |
pic[y] = make([]uint8, dx) |
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 ( | |
"strings" | |
"golang.org/x/tour/wc" | |
) | |
func WordCount(s string) map[string]int { | |
wordCount := make(map[string]int) | |
for _, word := range strings.Fields(s) { |
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" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
f0 := 0 | |
f1 := 1 | |
return func() int { |
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
javascript:var d=new Date();location.href='https://www.asken.jp/wsp/meal/breakfast/'+d.getFullYear()+'-'+('0'+(d.getMonth()+1)).slice(-2)+'-'+('0'+d.getDate()).slice(-2) |