Skip to content

Instantly share code, notes, and snippets.

View camiloribeiro's full-sized avatar
🐰
Coding @ Spotify

Camilo Ribeiro camiloribeiro

🐰
Coding @ Spotify
View GitHub Profile
@camiloribeiro
camiloribeiro / gist:920d12e2f90ce3ac01d8f85c80594549
Created December 19, 2016 13:26
follow changes and run tests on mac
fswatch -r -o -e 'pyc' . | (while read; do python *_test.py; done)
@camiloribeiro
camiloribeiro / pipeline_jenkins2.groovy
Last active November 23, 2016 23:17
Example jenkins 2 pipeline
stage 'test'
parallel (
"scenario A": {
node {
echo 'dry run'
}
},
"scenario B": {
node {
echo 'dry run'
@camiloribeiro
camiloribeiro / gist:d5377ea528952558267a
Created April 23, 2015 08:18
join trigger jenkins jobdsl
configure { project -> project / publishers << 'join.JoinTrigger' {
'joinProjects'{}
'joinPublishers' {
'hudson.plugins.parameterizedtrigger.BuildTrigger' {
'configs' {
'hudson.plugins.parameterizedtrigger.BuildTriggerConfig' {
'configs' {
'hudson.plugins.parameterizedtrigger.PredefinedBuildParameters' {
properties(‘SOME_PARAM=$SOME_PARAM\nSOME_OTHER_PARAM=$SOME_OTHER_PARAM')
}
docker ps -a -q > remove && for line in $(cat remove); do docker rm -f $line ; done && rm -f remove
docker images -q > remove && for line in $(cat remove); do docker rmi -f $line ; done && rm -f remove
@camiloribeiro
camiloribeiro / installRvmAndRubies.sh
Created March 4, 2014 13:31
Installing rvm and most common ruby versions (require curl installed!)
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source ~/.profile
rvm install ruby-1.8.7-p374
rvm install ruby-1.9.1-p431
rvm install ruby-1.9.3-p484
rvm install ruby-2.0.0-p353
rvm install ruby-2.1.0
@camiloribeiro
camiloribeiro / robot.js
Created December 5, 2012 16:17
QARobot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
rspec --require ./watir_html_formatter.rb --format WatirHtmlFormatter --out output/index.html test/bar_spec.spec
require "rspec/core/formatters/base_text_formatter"
class WatirHtmlFormatter < RSpec::Core::Formatters::BaseTextFormatter
end
def extra_failure_content(failure)
content = []
content << "<span>"
file_name = save_html
content << link_for(file_name)
@camiloribeiro
camiloribeiro / get_cpfs.rb
Created October 26, 2012 20:56
Get cpf numbers
require "watir-webdriver"
b = Watir::Browser.new
b.goto "http://www.geradordecpf.org/"
arr = Array.new
5000.times do |i|
b.button(:value => "Gerar").click
arr.push(b.text_field(:id => "numero").value)
@camiloribeiro
camiloribeiro / capirb.txt
Created October 10, 2012 14:12 — forked from peterkappus/capirb.txt
Capybara in IRB
# copy and paste this into your terminal to start an IRB session and use Capybara's DSL to write tests interactively
# Thanks to Tom Clements
# http://tom-clements.com/blog/2012/02/25/capybara-on-the-command-line-live-browser-testing-from-irb/
irb
require 'capybara/dsl'
include Capybara::DSL
Capybara.default_driver = :selenium
visit "http://127.0.0.1:3000"
visit "http://www.google.com" #etc...