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.
window.ActiveAdminSortableEvent = do -> | |
eventToListeners = {} | |
return { | |
add: (event, callback) -> | |
if not eventToListeners.hasOwnProperty(event) | |
eventToListeners[event] = [] | |
eventToListeners[event].push(callback) | |
trigger: (event, args) -> |
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.
require 'bundler/capistrano' | |
set :application, "net" | |
set :repository, "git@githost.com:net.git" | |
set :scm, :git | |
set :default_environment, { | |
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | |
} |
/* | |
* Random-Number Utilities (randutil) | |
* Addresses common issues with C++11 random number generation. | |
* Makes good seeding easier, and makes using RNGs easy while retaining | |
* all the power. | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Melissa E. O'Neill | |
* |
:arg **/**.{h,cpp} | |
:argdo %s/\(new NextAction(.\{-})\)/NextActionPtr(\1)/ge | update | |
:argdo %s/\(new NextAction([^()]*)\)/NextActionPtr(\1)/ge | update |
files = Dir["./**/**.{h,cpp}"] | |
def inplace_edit(file, bak, &block) | |
old_stdout = $stdout | |
argf = ARGF.clone | |
argf.argv.replace [file] | |
argf.inplace_mode = bak | |
argf.each_line do |line| | |
yield line |
#include <iostream> | |
void bubble_sort(int arr[5]) { | |
for (int i = 0; i < 5; ++i) { | |
for (int j = 1; j < (5 - i); ++j) { | |
if (arr[j-1] > arr[j]) { | |
int temp = arr[j-1]; | |
arr[j-1] = arr[j]; | |
arr[j] = temp; | |
} |
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.
require 'base64' | |
require 'cgi' | |
require 'openssl' | |
base = 'POST&https%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.json&include_entities%3Dtrue%26oauth_consumer_key%3Dxvz1evFS4wEEPTGEFPHBog%26oauth_nonce%3DkYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1318622958%26oauth_token%3D370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb%26oauth_version%3D1.0%26status%3DHello%2520Ladies%2520%252B%2520Gentlemen%252C%2520a%2520signed%2520OAuth%2520request%2521' | |
key = 'kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw&LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE' | |
puts CGI.escape(Base64.encode64("#{OpenSSL::HMAC.digest('sha1', key, base)}\n")) |
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
require "bundler/capistrano" | |
set :rvm_ruby_string, '1.9.3' | |
set :rvm_type, :user # Literal ":user" | |
set :application, "blog_test" | |
set :repository, "git@github.com:ryancheung/blog.git" | |
set :scm, :git |