Skip to content

Instantly share code, notes, and snippets.

View gelias's full-sized avatar

Guilherme Elias gelias

View GitHub Profile
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|GET|CONNECT|POST|HEAD)
RewriteRule .* - [F]
#!/bin/sh
host=<URL_HOST>
port=<PORT>
cmd="GET http://<URL_DESTINY> HTTP/1.1 Host: www.<URL_HOST>"
( echo open ${host} ${port}
sleep 1
echo -e "\r"
sleep 1
echo ${cmd}
package me.umov.auth;
import me.umov.auth.client.AuthenticationClient;
import me.umov.auth.client.AuthenticationClientImpl;
import me.umov.auth.client.model.LoginResponse;
import me.umov.auth.client.types.ModuleType;
public class AuthorizationTest {
@Test
#!/bin/ruby
full_filename = ARGV[0]
text_to_search = ARGV[1]
fileObj = File.new(full_filename, "r")
while (line = fileObj.gets)
if line.include? text_to_search
puts(line)
end
end
package cc.routing.gmaps.service
import com.google.maps.DirectionsApi;
import com.google.maps.DirectionsApiRequest;
import com.google.maps.GeoApiContext;
import com.google.maps.model.DirectionsRoute;
import com.google.maps.model.LatLng;
import com.google.maps.model.TravelMode;
public class GMapsDirectionsService {
@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
@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 / 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
require 'rubygems'
require 'sinatra'
set :port => 80
get '/' do
"Welcome"
end
@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