Skip to content

Instantly share code, notes, and snippets.

View gelias's full-sized avatar

Guilherme Elias gelias

View GitHub Profile
@gelias
gelias / watirwebdriver_sample.rb
Created July 16, 2012 01:37
Sample ruby script using watir-webdriver
require 'watir-webdriver'
firefox_instance = Watir::Browser.new :firefox
firefox_instance.goto 'http://bit.ly/M1mjNB'
firefox_instance.close
@gelias
gelias / text_field_spec.rb
Created July 19, 2012 05:21
Preenchendo um campo do tipo text
require 'rubygems'
require 'watir-webdriver'
require 'rspec'
describe "Look for browser elements" do
FIRST_NAME = 'Guilherme'
before(:each) {puts 'inicou'}
after(:each) {@firefox.close unless @firefox.nil?}
@gelias
gelias / cardapiaria_setup.sh
Created September 1, 2012 12:09
Cardapiaria Setup
#!/bin/bash
clear
echo -e "Preparing to start ...\n"
cd /Users/gelias/workspace/ruby
echo -e "removing oldest version ... \n"
rm -rf /Users/gelias/workspace/ruby/cardapiaria
echo -e "using ruby version 1.9.3 and Rails 3.2"
rvm 1.9.3@rails32
@gelias
gelias / a_h_top_and_most.sh
Created October 17, 2012 15:13
Script bash to download and install using yum service some helper tools to manage S.O.
#!/bin/bash
# Create temp folder to download rpms
mkdir /tmp/rpms
cd /tmp/rpms
# Download HTOP, ATOP, MOST
yum install htop atop most -y
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
@gelias
gelias / api_umov_me_sample.rb
Last active August 29, 2015 14:14
Sample in Ruby to integrate with uMov.me API
require 'rubygems'
require 'rest-client'
require 'xmlsimple'
class Resource
TOKEN = "PUT_YOUR_TOKEN_HERE"
BASE_URL = "http://api.umov.me/CenterWeb/api/#{TOKEN}"
def resource_name
require 'rubygems'
require 'sinatra'
set :port => 80
get '/' do
"Welcome"
end
@gelias
gelias / gist:256410dd6f5132a98eea
Last active July 23, 2017 16:17
database_diarioclasse.sql
-- Create database diarioclasse
CREATE DATABASE diarioclasse
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
-- Connect to database diarioclasse
-- Create sequence pessoa_codigo
@gelias
gelias / gist:13bf5415dd7b5524f579
Created July 13, 2015 02:42
Download file using wget
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz" -O jdk-7u80-linux.tar.gz
tar zxvf jdk-7u80-linux.tar.gz
@gelias
gelias / Program.cs
Last active February 5, 2016 16:11
Sample Code using C# to integrate with uMov.me API
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace ConsoleAPI