Skip to content

Instantly share code, notes, and snippets.

View lennonjesus's full-sized avatar
🎯
Focusing

Lennon Jesus lennonjesus

🎯
Focusing
View GitHub Profile
@lennonjesus
lennonjesus / .gitconfig
Created August 9, 2011 18:26
Arquivo necessário para configurar o git no Windows (msysgit) através de um proxy com autenticação
[user]
name = Your Name Here
email = yourmail@yourdomain.com
[http]
proxy = http://[username]:[password]@[host]:[port]
[alias]
st = status
ci = commit
co = checkout
nome = 'Lennon'
if nome == 'Lennon'
alert "Hello Lennon!"
else
alert "Hello CoffeeScript!"
#cubes = (math.cube num for num in list)
@lennonjesus
lennonjesus / .gitconfig
Created August 17, 2011 02:38
Configurações para colorir o output dos comandos git
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
@lennonjesus
lennonjesus / serial.rb
Created November 28, 2011 02:03
Arduino - Enviando e recebendo dados com ruby
# Lennon Jesus - lennon d.o.t. jesus a.t. gmail d.o.t. com
require "serialport"
port_str = "/dev/ttyACM0"
baud_rate = 9600
data_bits = 8
stop_bits = 1
parity = SerialPort::NONE
@lennonjesus
lennonjesus / .gitignore
Created May 6, 2013 13:51
Arquivo com padrões de extensões de arquivos e diretórios comumente ignorados.
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@lennonjesus
lennonjesus / drop_all_tables_oracle.sql
Created June 13, 2013 19:31
Script to drop all table in a oracle database
-- drop all tables in current schema
declare
table_name varchar2(30);
cursor usertables is select * from user_tables where table_name not like 'BIN$%';
begin
for next_row in usertables
loop
execute immediate 'drop table ' || next_row.table_name || ' cascade constraints';
end loop;
@lennonjesus
lennonjesus / create_synonyms_oracle.sql
Created June 13, 2013 19:32
Script to automaticaly create oracle synonyms
-- executar como usuario aplicacao
set serveroutput on
DECLARE
p_owner VARCHAR(10) := 'GPOP';
v_comando VARCHAR2(1000);
CURSOR cur_synonym IS
SELECT 'CREATE OR REPLACE SYNONYM '||p_owner||'_APLICACAO.' || object_name || ' FOR ' || p_owner || '.' || object_name
@lennonjesus
lennonjesus / oracle_grant_access.sql
Created June 13, 2013 19:32
Script to grant privileges in oracle
-- executar como usuario OWNER
set serveroutput on
DECLARE
v_owner VARCHAR(10) := TRIM(UPPER('GPOP'));
v_comando VARCHAR2(1000);
-- Cursor de DRL nas tabelas
@lennonjesus
lennonjesus / what_java_collection
Created June 28, 2013 16:58
What Java Collection?
"Will it contain key/value pair or values only?"
Pairs
"Is element order important?"
Yes
"Insertion order or sorted by keys?"
Key sorted
"Should it be synchronized?"
Yes
HashTable
No