Skip to content

Instantly share code, notes, and snippets.

View wbotelhos's full-sized avatar
💭
I'm not my code.

Washington Botelho wbotelhos

💭
I'm not my code.
View GitHub Profile
@wbotelhos
wbotelhos / rastrear_encomenda_correios_for_mac
Created February 4, 2011 20:36 — forked from leohackin/rastrear_encomenda_correios_for_mac
Rastreador de Encomendas dos Correios.
#!/bin/bash
# Created by Léo Hackin (leohackin at gmail.com), Jan 2011
# This file is free software. You are free to use this file in any way you like
# However, if you change it you should note in this file that you did and who
# you are, you also need to change the version string if you do. That way
# I will not get support questions for software that is not entirely mine.
# rastreia_encomenda_correios v.0.1a for mac
@wbotelhos
wbotelhos / gist:1080690
Created July 13, 2011 16:31
Verifies if a JSON object is empty.
function isEmpty(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
return false;
}
}
return true;
};
@wbotelhos
wbotelhos / gist:1171694
Created August 25, 2011 19:59
JSON formatado no console
// Exibindo o JSON no console
curl "http://api.twitter.com/1/trends.json" | python -mjson.tool
// Salvando em algum arquivo
curl "http://api.twitter.com/1/trends.json" | python -mjson.tool > response.json
@wbotelhos
wbotelhos / proposta-qconsp-2011.txt
Created August 26, 2011 04:47
Lightning Talk QCONSP 2011
https://docs.google.com/spreadsheet/viewform?formkey=dGRrUnFwNmZBMkRLN25xN0NtMGNOeFE6MQ
Controle de Permissão com VRaptor 3
Será apresentado uma forma fácil e eficaz de criar um controle de permissão de acesso
baseado nas roles de cada usuário utilizando o VRaptor 3. Apresentando o conceito de
interceptor e annotation sua aplicação pode ter um maior controle sobre as ações ocorridas.
@wbotelhos
wbotelhos / gist:1207121
Created September 9, 2011 19:30
Recognize Mac OS X Lion x86_64 for DB2 installation
// At line 118 located after the i*86) case on db2setup and db2_install file, insert:
x86_64)
INSTALLDIR="${PROGDIR?}/db2/macos/install"
PLATNAME="MacOS/x86_64" ;;
@wbotelhos
wbotelhos / gist:1213047
Created September 13, 2011 03:03
Installing DB2 9.7 on Unbuntu
sudo apt-get install libstdc++5
sudo apt-get install libaio-dev
sudo ./db2setup
@wbotelhos
wbotelhos / gist:1355100
Created November 10, 2011 15:21
Solving socket '/tmp/mysql.sock' (2)
1. sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
2. cd /tmp
3. ln -s /var/lib/mysql/mysql.sock mysql.sock
3. sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
@wbotelhos
wbotelhos / gist:1901194
Created February 24, 2012 14:16
jQuery show and hide methods
if (boo) {
$(elem).show();
} else {
$(elem).hide();
}
$(elem)[boo ? 'show' : 'hide']();
$(elem).toggle(boo);
@wbotelhos
wbotelhos / gist:2031577
Created March 13, 2012 21:04
Ajax Exception Interceptor
@Intercepts
public class AjaxExceptionInterceptor implements Interceptor {
private final HttpServletRequest request;
private final Result result;
public AjaxExceptionInterceptor(HttpServletRequest request, Result result) {
this.request = request;
this.result = result;
}
@wbotelhos
wbotelhos / gist:2032835
Created March 14, 2012 00:02
Log4j File Appender
# DEBUG INFO WARN ERROR FATAL
log4j.rootCategory=WARN, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss} %-5p [%-30c{1}] %m%n
log4j.appender.file.File=/home/your-user/log.log
log4j.appender.file.MaxBackupIndex=2
log4j.appender.file.MaxFileSize=1MB