This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Refactored from: http://snippets.dzone.com/posts/show/4712 | |
Spec::Matchers.define :protect_attributes do |*attributes| | |
match do |target| | |
calculate_protected_methods(target) | |
perform_check(attributes) | |
end | |
failure_message_for_should do |target| | |
"expected #{@failed_attribute} to be protected" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
exec heroku "$@" --app "`basename $PWD`-staging" | |
#!/bin/bash | |
set -eux | |
exec heroku "$@" --app "`basename $PWD`-production" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vasculhando a papelada em casa encontrei este rascunho. | |
Acho que foi escrito na palestra pública pré-Empretec. | |
Não me preocupei em corrigir concordância, quis registrar como foi escrito na ocasião. | |
*** | |
"Ideia de Negócio" é diferente de "Oportunidade de Negócio" | |
Empreender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CAVEIRA! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :heroku do | |
APP = 'startupdev-ideas' | |
def run(*cmd) | |
system(*cmd) | |
raise "Command #{cmd.inspect} failed!" unless $?.success? | |
end | |
def confirm(message) | |
print "\n#{message}\nAre you sure? [Yn] " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Controllers | 63 | 53 | 2 | 7 | 3 | 5 | | |
| Helpers | 7 | 7 | 0 | 1 | 0 | 5 | | |
| Models | 12 | 10 | 1 | 1 | 1 | 8 | | |
| Libraries | 40 | 36 | 0 | 1 | 0 | 34 | | |
| Model specs | 33 | 27 | 0 | 1 | 0 | 25 | | |
| View specs | 0 | 0 | 0 | 0 | 0 | 0 | | |
| Controller specs | 148 | 121 | 0 | 1 | 0 | 119 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
describe Notification do | |
describe "idea created" do | |
before(:each) do | |
@idea = Idea.new({ | |
:author_name => 'Nome do Usuario', | |
:author_email => '[email protected]', | |
}) | |
@idea.stub(:id).and_return(98765) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model | |
before_create :set_edit_code | |
def self.friendly_token | |
ActiveSupport::SecureRandom.hex(10) | |
end | |
def self.edit_code_exists?(edit_code) | |
!where(:edit_code => edit_code).first.nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[09:18am] adams.freenode.net: [freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp | |
[09:27am] mergulhao joined the chat room. | |
[09:31am] dannluciano joined the chat room. | |
[09:31am] dannluciano: bom dia pessoal | |
[09:34am] willian joined the chat room. | |
[09:34am] willian: bom dia! | |
[09:35am] willian: sobre o q será o projeto hj? | |
[09:35am] ChanServ made this room no longer a secret. | |
[09:35am] ChanServ changed this room to require operator status to change the topic. | |
[09:35am] rafael_lima: Bom Dia! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# application.html.erb | |
<%= render_flash_messages %> | |
# application_helper.rb | |
def has_flash_messages? | |
flashes = [:alert, :notice, :warning, :message, :failure] | |
flash and flashes.find { |key| flash.has_key?(key) } | |
end |
OlderNewer