Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Wheeler AlexWheeler

View GitHub Profile
View tmux.conf
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
#clear screen w/ prefix 'c-l'
bind C-l send-keys 'C-l'
set -g default-terminal "screen-256color"
set -g utf8 on
View verb_constraint.rb
match 'properties', to: 'properties#index', via: [:get, :post]
View routes.rb
match 'properties', to: 'properties#index', via: [:get, :post]
View routes.rb
match 'properties', to: 'properties#show', via: :all
View routes.rb
get 'properties/:slug', to: 'properties#show', constraints: { slug: /[a-z]+\.\d+/ }
View routes.rb
get 'dashboard', to: 'dashboard#index', constraints: { subdomain: 'staging' }
View routes.rb
root 'iphone#index', constraints: lambda { |req| req.env['HTTP_USER_AGENT'] =~ /iPhone/ }
root 'web#index'
View routes.rb
constraints(subdomain: ['admin', 'staging']) do
get 'properties', to: 'properties#show'
post 'properties', to: 'properties#create'
get 'dashboard', to: 'main#dashboard'
end
View routes.rb
constraints(IphoneAdmin) do
#your routes
end
View basic_config.ru
require 'rack'
#run proc { |env| ['200', { 'Content-Type' => 'text/html' }, ['code is a liability']] }
class MyRackApp
def call(env)
['200', { 'Content-Type' => 'text/html' }, ['code is a liability']]
end
end
run MyRackApp.new