Skip to content

Instantly share code, notes, and snippets.

View pedrolopesme's full-sized avatar
💡
Coding.

Pedro Mendes pedrolopesme

💡
Coding.
View GitHub Profile
fun myFunction(name: String){
// name nunca será null. Dentro do escopo desta função
// não há a necessidade de checar se name == null
println(name.length);
}
fun main(args: Array<String>){
var myVar:String = null;
}
@pedrolopesme
pedrolopesme / docker_image_versions.sh
Last active March 6, 2017 18:55
Listing all docker image versions available from a specific repo
# BASIC COMMAND
$ wget -q https://registry.hub.docker.com/v1/repositories/<USER>/<IMAGE>/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
# EXAMPLE: LISTING ALL JBOSS IMAGES
$ wget -q https://registry.hub.docker.com/v1/repositories/jboss/wildfly/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
# OUTPUTS :
latest
10.0.0.Final
10.1.0.Final
# Banco Itaú
class BoletoItau < Boleto
def gerar_header
puts("Header do Boleto para o Banco Itau")
end
def gerar_footer
puts("Footer do Boleto : Esse boleto deve ser pago no Banco Itau mais proximo")
end
end
class Boleto
def initialize(valor, vencimento)
@valor = valor
@vencimento = vencimento
end
def gerar_boleto
gerar_header
gerar_valor
gerar_vencimento
gerar_footer
class BoletoSantander
def initialize(valor, vencimento)
@valor = valor
@vencimento = vencimento
end
def gerar_boleto
puts("Header do Boleto para o Banco Santander")
class BoletoItau
def initialize(valor, vencimento)
@valor = valor
@vencimento = vencimento
end
def gerar_boleto
puts("Header do Boleto para o Banco Itau")
puts("Valor:" + @valor )
puts("Vencimento:" + @vencimento )
$ rake cucumber
/Users/pedrolopesme/.rvm/rubies/ruby-1.9.3-p448/bin/ruby -S bundle exec cucumber --profile default
Using the default profile...
Feature: Search For PageObject Article
As a Blog do Pedro visitor
I want to find for PageObjects article
Scenario: # features/001_search_for_pageobject_article.feature:6
Given I am on Blog do Pedro's Home Page # features/steps_definitions/001_search_for_pageobject_article.rb:3
page.text_field # retorna o valor do campo de text ou (se for um link ou button), clica no element
page.text_field= # Atribuí um valor
page.text_field_element # Retorna o próprio elemento
# encoding: UTF-8
require 'page-object'
require_relative '../../../config/env'
class HomePage
include PageObject
page_url "http://www.blogdopedro.net/"