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.
| # Resize selenium browser window to avoid Selenium::WebDriver::Error::MoveTargetOutOfBoundsError errors | |
| # | |
| # Example usage with Rspec (in spec/support/spec_helper.rb): | |
| # | |
| # config.before(:each) do | |
| # set_selenium_window_size(1250, 800) if Capybara.current_driver == :selenium | |
| # end | |
| # | |
| def set_selenium_window_size(width, height) | |
| window = Capybara.current_session.driver.browser.manage.window |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| # http://stackoverflow.com/a/8936202 | |
| # | |
| # ActiveAdmin already includes the necessary jquery in active_admin/base, | |
| # so just add this to javascripts/active_admin.js after //= require active_admin/base | |
| # | |
| # | |
| # Serialize and Sort | |
| # | |
| # model_name - you guessed it, the name of the model we are calling sort on. | |
| # This is the actual variable name, no need to change it. |
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, "[email protected]:net.git" | |
| set :scm, :git | |
| set :default_environment, { | |
| 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | |
| } |
$ echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3you should succesfully installing postgresql 9.3.2 on your machine.
| # rubocop config files for small Rails4/Ruby2 project | |
| # blog post: http://joanswork.com/rubocop-rails-getting-started/ | |
| # .rubocop.yml | |
| AllCops: | |
| Include: | |
| - Rakefile | |
| - config.ru | |
| Exclude: |
| # replace file basename with a UUID when uploaded | |
| # e.g.: avatar.jpg becomes 41bf830f-80cf-4efe-ad90-3b29bc6708b5.jpg | |
| # but don't regenerate a UUID each time file url is accessed | |
| class User < ActiveRecord::Base | |
| has_attached_file :avatar, path: ":basename.:extension" | |
| before_validation { set_avatar_file_name } | |
| def set_avatar_file_name | |
| # replace any NEW filename with a UUID |
| #! /bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |
| /* | |
| * 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 | |
| * |