Skip to content

Instantly share code, notes, and snippets.

View rkellermeyer's full-sized avatar

Richard Kellermeyer rkellermeyer

  • USA
View GitHub Profile

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.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

@rkellermeyer
rkellermeyer / rbenv_plugin_list
Created November 14, 2014 02:06
Essential rbenv plugins
For environment specific vars: https://github.com/sstephenson/rbenv-vars
For handling gemsets: https://github.com/jf/rbenv-gemset
Easily build rubies: https://github.com/sstephenson/ruby-build
RbEnv driven Bundler: https://github.com/carsomyr/rbenv-bundler
Find info on gems: https://github.com/rkh/rbenv-whatis.git
Alias `use` & mimic rvm: https://github.com/rkh/rbenv-use.git
Automatically rehash RbEnv: https://github.com/sstephenson/rbenv-gem-rehash.git
@rkellermeyer
rkellermeyer / cap_error
Last active August 29, 2015 14:23
Cap Auth Error
$ bundle exec cap dev_sandbox deploy
INFO [c3608890] Running /usr/bin/env mkdir -p /tmp/capstan/ on capstan-dev-sandbox.stonecroptech.com
DEBUG [c3608890] Command: ( RAILS_ENV=dev_sandbox /usr/bin/env mkdir -p /tmp/capstan/ )
INFO [7aecad29] Running /usr/bin/env mkdir -p /tmp/capstan/ on capstan-dev-sandbox-dj.stonecroptech.com
DEBUG [7aecad29] Command: ( RAILS_ENV=dev_sandbox /usr/bin/env mkdir -p /tmp/capstan/ )
cap aborted!
Authentication failed for user capstan@capstan-dev-sandbox.stonecroptech.com
/Users/rkellermeyer/.rvm/gems/ruby-1.9.3-p551@badger/gems/net-ssh-2.8.0/lib/net/ssh.rb:217:in `start'
/Users/rkellermeyer/.rvm/gems/ruby-1.9.3-p551@badger/gems/sshkit-1.3.0/lib/sshkit/backends/connection_pool.rb:25:in `create_or_reuse_connection'
/Users/rkellermeyer/.rvm/gems/ruby-1.9.3-p551@badger/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:173:in `ssh'
@rkellermeyer
rkellermeyer / user.rb
Created February 12, 2012 19:22
Using Redis to log categories that a user can follow
class User < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :zipcode
attr_accessor :password
before_save :encrypt_password
validates_confirmation_of :password
validates_presence_of :password, :on => :create
validates_presence_of :email
validates_uniqueness_of :email
@rkellermeyer
rkellermeyer / background_nested.html
Created August 4, 2012 20:59
Give nested div same color as background
<!DOCTYPE HTML>
<html lang="ru-RU">
<head>
<meta charset="UTF-8">
<title></title>
<style>
body, .nested {
background: blue;
}
.container, .nested {
@rkellermeyer
rkellermeyer / _form.html.haml
Created August 16, 2012 15:55
can't dump anonymous class #<Class:0x007fe4c7d29228>
= semantic_form_for [:admin, @sale], html: { :class => "filter_form" } do |f|
= select "sale_", "id", Sale.all.collect{ |s| [s.title + " " + s.start_date.to_s, s.id] }, {include_blank: true}, class: "sale_dropdown"
= f.inputs "Sale Information" do
= f.input :sales_merchandiser_id, :as => :hidden, :value => proc{current_user.id}
= f.input :category_id, as: :hidden
= f.input :title
= f.input :featured_image, as: :file, label: "Sale Image"
= content_tag :li, class: "field_toggle" do
%span.show_overwrite_fields Overwrite Versions
%span.hide_overwrite_fields Cancel Override
@rkellermeyer
rkellermeyer / routes.rb
Created September 5, 2012 22:27
No Ransack::Search object was provided to search_form_for! when using ActiveAdmin
MyAppName::Application.routes.draw do
# ...
namespace :admin do
resources :sales do
resources :consignment_items do
collection { post :search_items, to: 'sales#search_consignment_items' }
end
end
end
# ...
@rkellermeyer
rkellermeyer / errors.txt
Created September 19, 2012 01:00
Form Nested on non-Modal view
Routing Error
No route matches {:action=>"new", :controller=>"messages"}
Try running rake routes for more information on available routes.
@rkellermeyer
rkellermeyer / application.html.haml
Created October 6, 2012 16:41
"can't dup NilClass" type error in search
# ...
= semantic_form_for users_path, :method => 'get', :id => "users_search" do |f|
= f.input :search, params[:search]
= f.submit_tag
#...
@rkellermeyer
rkellermeyer / auth_net_samples.php
Created November 16, 2012 20:44
Auth.net PHP samples
<?php
require_once '../anet_php_sdk/AuthorizeNet.php'; // The SDK
$url = "http://YOURSITE.tld/post_result.php";
$api_login_id = '######';
$transaction_key = '#############';
$md5_setting = '######'; // Your MD5 Setting
$amount = "5.99";
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);
define("AUTHORIZENET_API_LOGIN_ID", $api_login_id);