- Rails v5.0.5
helper = ActionView::Base.new
helper.lookup_context.view_paths << Rails.root.join("app/views")
# e.g.) app/views/shared/post_elements/heading/_heading.html.haml| /** | |
| * @example | |
| * ```ts | |
| * hyphenize("someCamelCaseString"); | |
| * //=> "some-camel-case-string" | |
| * | |
| * hyphenize("ABigHouse"); | |
| * //=> "a-big-house" | |
| * ``` | |
| */ |
| ja: | |
| activerecord: | |
| models: | |
| admin_user: 管理ユーザー | |
| attributes: | |
| default: &default | |
| nickname: ニックネーム | |
| email: メールアドレス | |
| bio: BIO |
| #!/bin/sh | |
| # http://qiita.com/yuku_t/items/ad072418290a2b01a35a | |
| # A: Added | |
| # M: Modified | |
| files=$(git diff --cached --name-only --diff-filter=AM | grep '\.rb$') | |
| if [ -n "$files" ]; then | |
| bundle exec rubocop --force-exclusion ${files} | |
| # For docker: |
helper = ActionView::Base.new
helper.lookup_context.view_paths << Rails.root.join("app/views")
# e.g.) app/views/shared/post_elements/heading/_heading.html.hamlhttp://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html
http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html
DynamoDB's scan operation fetches only 1MB at one time and it adds LastEvaluatedKey (LEK) in the response if it has a next page.
| /** | |
| * @example | |
| * document.getElementById("messages").append( | |
| * strToHTML('<div class="message">foo</div>') | |
| * ); | |
| */ | |
| function strToHtml(rawStr: string) { | |
| var parser = new DOMParser(); | |
| var html = parser.parseFromString(rawStr, 'text/html'); | |
| return html.body.children[0]; |
| class Test | |
| extend Gem::Deprecate | |
| # DEPRECATED | |
| def foo | |
| puts "foo" | |
| end | |
| def bar | |
| puts "bar" |
| # frozen_string_literal: true | |
| require "bundler/inline" | |
| gemfile do | |
| source "https://rubygems.org" | |
| gem "virtus" | |
| end |
| const SECONDS = 1000; | |
| const MINUTES = SECONDS * 60; | |
| const HOURS = MINUTES * 60; | |
| interface Result { | |
| hours: number; | |
| minutes: number; | |
| seconds: number; | |
| } |