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
module.exports = { | |
I: '我が名は神龍', | |
actions: { | |
waitForElement: '要素が表示されるまで待ってやろう', | |
waitForClickable: 'クリック可能になるまで待ってやろう', | |
waitForVisible: '要素が見えるようになるまで待ってやろう', | |
waitForText: 'テキストが表示されるまで待ってやろう', | |
refresh: 'ページを更新してやろう', | |
amOnPage: 'URLにアクセスしてやろう', | |
click: 'クリックしてやろう', |
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 StylesController | |
def show | |
# Local variables assign to ERb | |
locals = { | |
base_color: current_user.base_color | |
} | |
# Render ERb to Sass (app/views/styles/template.sass.erb) | |
sass_contents = self.class.new.render_to_string('template', | |
formats: [:sass], |
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
# == Paperclip without ActiveRecord | |
# | |
# Simple and lightweight object that can use Paperclip | |
# | |
# | |
# Customized part can be extracted in another class which | |
# would inherit from SimplePaperclip. | |
# | |
# class MyClass < SimplePaperclip | |
# attr_accessor :image_file_name # :<atached_file_name>_file_name |
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
############################################################################# | |
## | |
## extended_gcd.rb | |
## | |
## given non-negative integers a > b, compute | |
## coefficients s, t such that gcd(a, b) == s*a + t*b | |
## | |
def extended_gcd(a, b) | |
# trivial case first: gcd(a, 0) == 1*a + 0*0 |