I hereby claim:
- I am twe4ked on github.
- I am odin (https://keybase.io/odin) on keybase.
- I have a public key whose fingerprint is E7CF B17B 6556 F44C 4D10 4B26 1ED7 776D C9D6 B110
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# | |
# The maximum length of a multiplexed packet is 32,768 bytes | |
# | |
# Unfortunately this works best (only works) if you have an uncommon character | |
# in your prompt to split on. I use "»". | |
FILE = '/tmp/tmux-pane' | |
PROMPT = '»' |
# How to give your devise controllers all the same layout (e.g. "authentication" below) | |
class ApplicationController < ActionController::Base | |
layout :setup_layout | |
def setup_layout | |
return "authentication" if | |
[ConfirmationsController, PasswordsController, SessionsController, | |
RegistrationsController, UnlocksController].include? self.class | |
"application" | |
end |
# Send email to MockSMTP | |
config.action_mailer.delivery_method = :smtp | |
ActionMailer::Base.smtp_settings = { | |
:address => "localhost", | |
:port => 1025, | |
:domain => "localhost" | |
} |
def active_link?(controller, action = nil) | |
action_match = case | |
when action.nil? | |
true | |
when action.respond_to?(:include?) | |
action.include? params[:action] | |
else | |
action == params[:action] | |
end |
# link_to 'Foo', bar_path, :class => active_link?('some_controller', 'some_action') | |
# link_to 'Foo', bar_path, :class => active_link?('some_controller') # Active anywhere within the controller | |
def active_link?(controller, action = nil) | |
action_match = case | |
when action.nil? then true | |
when action.is_a?(Array) then action.include? params[:action] | |
else action == params[:action] | |
end | |
params[:controller] == controller && action_match ? 'active ' : '' |
- if Rails.env.development? | |
%link{:rel => 'shortcut icon', :href => "/favicon.ico?#{(100..200).to_a.shuffle[1]}"} |
@mixin ie6 { * html & { @content } } | |
#logo { | |
background-image: url("/images/logo.png"); | |
@include ie6 { background-image: url("/images/logo.gif"); } | |
} |
@mixin size($width, $height: $width) { | |
width: $width; | |
height: $height; | |
} | |
// Examples | |
#foo { | |
@include size(10px); | |
} |
# Written in a taxi on the way to Railscamp X | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = | |
config.consumer_secret = | |
config.oauth_token = | |
config.oauth_token_secret = | |
end |