YARD CHEATSHEET http://yardoc.org
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| package kibela | |
| type ID interface{} | |
| // The top-level query type to Kibela resources | |
| type Query struct { | |
| AccessToken AccessToken `json:"accessToken" validate:"required"` | |
| AccessTokens AccessTokenConnection `json:"accessTokens" validate:"required"` | |
| ArchivedGroups GroupConnection `json:"archivedGroups" validate:"required"` | |
| AttachmentByPath Attachment `json:"attachmentByPath" validate:"required"` |
| ## IPv6 Tests | |
| http://[::ffff:169.254.169.254] | |
| http://[0:0:0:0:0:ffff:169.254.169.254] | |
| ## AWS | |
| # Amazon Web Services (No Header Required) | |
| # from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories | |
| http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy | |
| http://169.254.169.254/latest/user-data | |
| http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME] |
| fn prepare<A: Clone + 'static, B: Clone, C, AB: Fn(A, B) -> C + 'static>(op: AB) -> Box<dyn Fn(A) -> Box<dyn Fn(B) -> C>> { | |
| let op_rc = Rc::new(op); | |
| Box::new( | |
| move |a: A| { | |
| let a_rc = Rc::new(a.clone()); | |
| let op_rc = op_rc.clone(); | |
| Box::new(move |b: B| { | |
| let a = a_rc.as_ref(); | |
| let op = op_rc.as_ref(); | |
| op(a.clone(), b.clone()) |
| // ==UserScript== | |
| // @name remove container | |
| // @include http*://b.hatena.ne.jp* | |
| // ==/UserScript== | |
| (function () { | |
| const configure = { | |
| 'https://anond.hatelabo.jp': true, | |
| 'https://togetter.com': true, | |
| 'https://twitter.com': true, |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| source "https://rubygems.org" | |
| # Fixed order | |
| gem "rails" | |
| # Alphabetical order | |
| gem "activerecord-belongs_to_if" | |
| gem "bcrypt" | |
| gem "email_validator" | |
| gem "execjs" |
| document | |
| .querySelector('#hello') | |
| .addEventListener( | |
| 'click', | |
| () => swal({ | |
| title: 'Hello HeartRails!', | |
| text: 'This alert is created by SweetAlert.', | |
| icon: "success", | |
| }) | |
| ) |
| <iframe | |
| style="width: 100%; height: 458px; overflow:hidden; border: 0" | |
| srcdoc='<html><body><style type="text/css">.gist .gist-data { height: 400px; }</style><script src="https://gist.github.com/mmmpa/6727e93c25553adbcdceefb8499f2287.js"></script></body></html>' | |
| > | |
| </iframe> |
| module Formtastic | |
| module Inputs | |
| module Base | |
| module Errors | |
| # override | |
| def error_sentence_html | |
| error_class = builder.default_inline_error_class | |
| template.content_tag(:p, full_message_errors.to_sentence.html_safe, :class => error_class) | |
| end |
| def pluck(*column_names) | |
| if loaded? && (column_names.map(&:to_s) - @klass.attribute_names - @klass.attribute_aliases.keys).empty? | |
| return records.pluck(*column_names) | |
| end | |
| if has_include?(column_names.first) | |
| construct_relation_for_association_calculations.pluck(*column_names) | |
| else | |
| relation = spawn | |
| relation.select_values = column_names.map { |cn| |