Skip to content

Instantly share code, notes, and snippets.

View FabricioFFC's full-sized avatar

Fabrício Ferrari de Campos FabricioFFC

View GitHub Profile
@FabricioFFC
FabricioFFC / rodoviarias-brasil.json
Created February 7, 2015 04:07
Latitude e longitude das rodoviárias do Brasil (mapeamento ainda em andamento - apenas as principais por enquanto)
[
{
"name": "Rodoviária Rio de Janeiro - Terminal Novo Rio",
"latitude": "-22.899193",
"longitude": "-43.209191,17"
},
{
"name": "Rodoviária de São Paulo - Terminal Tietê",
"latitude": "-23.516324",
"longitude": "-46.623764,17"
@FabricioFFC
FabricioFFC / .zshrc
Created September 10, 2015 16:08
.zshrc
# For Golang
# Path to your oh-my-zsh installation.
export ZSH=/Users/fabricio/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
@FabricioFFC
FabricioFFC / gist:856616
Created March 5, 2011 18:59
.bashrc - extra configuration
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
function rvm_version {
RVM_VERSION=`~/.rvm/bin/rvm-prompt`
if [[ -f "$(pwd)/Rakefile" ]] && [[ ! -z "$RVM_VERSION" ]]; then
echo "${RVM_VERSION} "
fi
}
if [[ -s ~/.rvm/scripts/rvm ]]
@FabricioFFC
FabricioFFC / gist:856842
Created March 5, 2011 23:53
gem.bat - Windows
@ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=C:
SET HOMEPATH=\Ruby187
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:\Ruby187\bin\gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
@FabricioFFC
FabricioFFC / watir_example.rb
Created March 6, 2011 00:24
Watir example (commented in Portuguese)
# importamos a biblioteca rubygems, sem ela não podemos importar o Watir
require 'rubygems'
# importamos a biblioteca do Watir
# require 'firewatir' se você estiver usando Linux/Mac ou se você
# quer usar o Firefox, ao invés, do IE (necessário instalar ele - gem install firewatir)
require 'watir'
puts "Abrindo navegador"
# aqui estamos passando para a variável browser a instância de um objeto Browser do Watir
# você verá que o IE irá abri
browser = Watir::Browser.new
@FabricioFFC
FabricioFFC / watir_installation.sh
Created March 7, 2011 00:53
Watir installation on Linux
#!/usr/bin/env bash
echo -e "\n\n"
echo -e "=> Instalando o Ruby e o Rubygems"
apt-get install ruby rubygems ruby-dev
echo export PATH=/var/lib/gems/1.8/bin:$PATH >> ~/.bashrc
echo -e "=> Atualizando Rubygems"
cd /tmp/
wget http://production.cf.rubygems.org/rubygems/rubygems-1.6.1.tgz
@FabricioFFC
FabricioFFC / watir_test_twitter.rb
Created March 8, 2011 20:18
Testing Twitter with Watir
require 'rubygems'
require 'watir'
#require 'firewatir' => se você estiver no Linux/Mac
class HomePage
HOME_PAGE = 'twitter.com'
def initialize
@browser = Watir::Browser.new
@FabricioFFC
FabricioFFC / elias_challenge.rb
Created March 15, 2011 21:55
Test using Watir to test a simple captcha
require 'rubygems'
require 'firewatir'
@browser = Watir::Browser.new
@browser.goto('http://www.eliasnogueira.info/arquivos_blog/selenium/desafio/soma.php')
number1 = @browser.label(:id, 'number1').text.to_i
number2 = @browser.label(:id, 'number2').text.to_i
sum = number1 + number2
@browser.text_field(:name, 'soma').value = sum
@browser.button(:name, 'submit').click
@FabricioFFC
FabricioFFC / elias_challenge.html
Created March 15, 2011 22:48
Test using Selenium IDE to test a simple captcha
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://www.eliasnogueira.info/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@FabricioFFC
FabricioFFC / gist:879746
Created March 21, 2011 16:38
Error code 104 - GAE
2011-03-21 09:24:38.185 / 500 47181ms 37455cpu_ms 0kb Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16,gzip(gfe)
189.68.16.247 - - [21/Mar/2011:09:24:38 -0700] "GET / HTTP/1.1" 500 217 - "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16,gzip(gfe)" "vizir-ics.appspot.com" ms=47182 cpu_ms=37455 api_cpu_ms=0 cpm_usd=1.040485 pending_ms=1144 exit_code=104 throttle_code=1
E 2011-03-21 09:24:37.572
javax.servlet.ServletContext log: unable to create shared application instance
org.jruby.rack.RackInitializationException: undefined method `blame_file!' for #<Java::ComGoogleApphostingApi::DeadlineExceededException:0x16bc6e5>
from file:/base/data/home/apps/vizir-ics/1.349156647874378203/WEB-INF/lib/gems.jar!/bundler_gems/jruby/1.8/gems/actionpack-2.3.11/lib/action_controller/routing/route_set.rb:287:in `load_routes!'
from org/jruby/RubyArray.java:1572:in `each'
from file:/base/data/home/apps