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.
#habla_window_div button, #habla_window_div input[type=submit] { | |
width: auto; | |
font-size: 14px; | |
margin: 5px 3px 0 5px!important; | |
} | |
#habla_window_div [class*=span] { | |
float: none; | |
margin-left: 0; | |
} | |
#habla_beta_container_do_not_rely_on_div_classes_or_names .habla_window_div_base { |
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.
#!/bin/bash | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do | |
git branch --track ${branch#remotes/origin/} $branch | |
done | |
git fetch && for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do git branch --track ${branch#remotes/origin/} $branch; done |
# Avoid annoying ActionController::UnknownHttpMethod exceptions like: | |
# | |
# ActionController::UnknownHttpMethod) "CONNECT, accepted HTTP methods are get, head, put, post, delete, and options" | |
# | |
# Install this file in app/metal and these requests will receive a 405 | |
# "Method Not Allowed" status and will be logged under `info'. | |
class IgnoreUnknownHttpMethod | |
def self.call(env) | |
[ | |
if ActionController::Request::HTTP_METHODS.include?(env["REQUEST_METHOD"].downcase) |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
require 'forwardable' | |
require 'thread' | |
require 'monitor' | |
module LolConcurrency | |
module Actor | |
Context = Struct.new(:method, :args, :block) | |
Async = Struct.new(:instance, :mailbox) do | |
extend Forwardable |
enable workspaces | |
gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 2 |
module RecognizePath | |
def recognize_path(path, options) | |
recognized_path = Rails.application.routes.recognize_path(path, options) | |
# We have a route that catches everything and sends it to 'errors#not_found', you might | |
# need to rescue ActionController::RoutingError | |
return recognized_path unless recognized_path.slice(:controller, :action) == {controller: 'errors', action: 'not_found'} | |
# The main app didn't recognize the path, try the engines... | |
Rails.application.railties.engines.each do |engine| |
source :rubygems | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
gem 'omniauth-facebook' | |
gem 'omniauth-twitter' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) |