Skip to content

Instantly share code, notes, and snippets.

Lucas Fais lucasfais

  • São Paulo, Brazil
Block or report user

Report or block lucasfais

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am lucasfais on github.
  • I am lucasfais (https://keybase.io/lucasfais) on keybase.
  • I have a public key whose fingerprint is 3B65 7DBB D1C2 BD25 E7FE 6807 DEC2 2EA0 6164 6E8A

To claim this, I am signing this object:

@lucasfais
lucasfais / gist:e920010308a254393f5a
Last active Aug 29, 2015
ssh aws instances by name tag
View gist:e920010308a254393f5a
# ssh aws instances by name tag
# jq required - http://stedolan.github.io/jq/
#
# Usage:
# $ aws-ssh <ssh_user_name> <instance_name>
#
function aws-ssh(){
ssh $1@$(aws ec2 describe-instances --filters "Name=tag-key,Values=Name" "Name=tag-value,Values=$2" --output json | jq -r .Reservations[0].Instances[0].PublicIpAddress)
}
View Azkfile.js
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
crawler: {
// Dependent systems
depends: ["elasticsearch"],
// More images: http://images.azk.io
@lucasfais
lucasfais / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lucasfais
lucasfais / operation_test.rb
Created Sep 28, 2008
Usando a macro should_require_attributes do Shoulda
View operation_test.rb
require 'test_helper'
class OperationTest < ActiveSupport::TestCase
should_require_attributes :description, :value
end
@lucasfais
lucasfais / gist:13472
Created Sep 28, 2008
Validando a presenca dos atributos description e value
View gist:13472
class Operation < ActiveRecord::Base
validates_presence_of :description, :value
end
View operation_test.rb
require 'test_helper'
class OperationTest < ActiveSupport::TestCase
context "A valid operation" do
setup do
@operation = Factory(:operation_one)
end
View factories.rb
Factory.define :operation_one, :class => Operation do |o|
o.description 'Salario'
o.category 'Proventos'
o.value 5000
end
Factory.define :operation_two, :class => Operation do |o|
o.description 'Gasolina'
o.category 'Transporte'
o.value -200
View operation_test.rb
# ...
should "return its value" do
operation = Factory(:operation_one)
assert_equal 5000, operation.value
end
should "return its category" do
operation = Factory(:operation_two)
assert_equal 'Transporte', operation.category
end
You can’t perform that action at this time.