View makesure.example.coffee
1 2 3 4 5 6 7 8 9 10
validateUser = makesure ->
@permit "name email" # optional
@attrs("name email").isNot('empty').orSay "can't be empty"
 
userInput =
name: ""
description: "My description"
admin: true
View designer.html
1 2 3 4 5 6 7 8 9 10
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../google-map/google-map.html">
 
<polymer-element name="my-element">
 
<template>
<style>
:host {
position: absolute;
width: 100%;
View .vimrc
1 2 3 4
" Add this to the end of vimrc
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
View deferred_garbage_collection.rb
1 2 3 4 5 6 7 8 9 10
# https://37signals.com/svn/posts/2742-the-road-to-faster-tests
 
# spec/support/performance/deferred_garbage_collection.rb
 
class DeferredGarbageCollection
DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || 15.0).to_f
 
@@last_gc_run = Time.now
 
def self.start
View Capybara.md

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
View slugable.rb
1 2 3 4 5 6 7 8 9
# app/models/concerns/slugable.rb
 
module Slugable
extend ActiveSupport::Concern
 
included do
validates_format_of :slug, :without => /^\d/
before_save :generate_slug
end
View simple_form_bootstrap.rb
1 2 3 4 5 6 7 8 9 10
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# you need an updated simple_form gem for this to work, I'm referring to the git repo in my Gemfile
config.input_class = "form-control"
 
config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.use :input
View simple_form_bootrap.rb
1 2 3 4 5 6 7 8 9 10
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: 'div', class: 'controls' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
View devise.pt-BR.yml
1 2 3 4 5 6 7 8 9 10
# encoding: UTF-8
# pt-BR translations for Devise
pt-BR:
devise:
confirmations:
confirmed: 'Sua conta foi confirmada com sucesso. Você está logado.'
send_instructions: 'Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta.'
send_paranoid_instructions: 'Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta.'
failure:
already_authenticated: 'Você já está logado.'
View routes.rb
1 2 3 4 5 6 7 8 9
ApplicationName::Application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
 
# You can have the root of your site routed with "root"
# root 'welcome#index'
 
# Example of regular route:
# get 'products/:id' => 'catalog#view'
Something went wrong with that request. Please try again.