- Anito-L-Mono
- Bitstream Vera Sans Mono
- Migu1M, Migu2M
- Noto Sans Mono CJK JP
“Content & Display Patterns,” an article by Dan Mall
- A Content pattern describes the types of elements within and can be rendered in multiple forms
- 要素のタイプを表現するパターン
- 複数の形態で描画できる
- A Display pattern describes a specific rendering and can be applied to multiple types of Content patterns
- 固有のレンダリングについてのパターン
- 色々なタイプのContentパターンに対して適用できる
- あるコンテンツのアイデンティティを考えるのはContentパターンについての考察である
- そのコンテンツをどのように描画するかのビジュアル的な選択について考えるのはDisplayパターンについての考察である
This file contains hidden or 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
body { | |
background-color: #fff; | |
&:after { | |
content: ''; | |
display: block; | |
background-image: linear-gradient(90deg, #a16eff 0%, #3dcebb 100%); | |
height: 4px; | |
position: absolute; | |
left: 0; | |
top: 0; |
This file contains hidden or 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
scenario 'User likes the post' do | |
visit post_path | |
click_button 'Like' | |
expect { page.has_css?('.liked-icon') }.to become_true | |
end |
This file contains hidden or 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
# You can preload associations explicitly. | |
# This method also can apply to polymorphic association. | |
# | |
# See also https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/preloader.rb | |
# | |
def index | |
@comments = Comment.order(id: :desc).limit(10) | |
# This prevents N+1 query for user and commentable associations | |
ActiveRecord::Associations::Preloader.new.preload(@comments, [:user, :commentable]) |
Tool:
Environment:
- Ruby 2.2.3
- Rails 4.2.5
This file contains hidden or 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
/* Event Parameters | |
{ | |
"accessKeyId": "...", | |
"secretAccessKey": "...", | |
"region": "ap-northeast-1", | |
"instanceId": "i-XXXXXXXX" | |
} | |
*/ | |
exports.handler = function(event, context) { | |
console.log('instanceId =', event.instanceId); |
This file contains hidden or 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
# Custom log formatter module for rails_12factor | |
# | |
module CustomLogFormatter | |
# Custom formatter for development environment. | |
# | |
# Examples | |
# | |
# # in controller | |
# logger.error(self.class) { 'This is a error message' } | |
# logger.info { 'This is a info message' } |
This file contains hidden or 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
# Custom logger formatter for development environment. | |
# | |
# Examples | |
# | |
# # in config/environments/development.rb | |
# config.log_formatter = ::DevelopmentLoggerFormatter.new | |
# | |
# # in controller | |
# logger.error(self.class) { 'This is a error message' } | |
# logger.info { 'This is a info message' } |