Skip to content

Instantly share code, notes, and snippets.

View thiagocaiubi's full-sized avatar
😄

Thiago Caiubi thiagocaiubi

😄
View GitHub Profile
@thiagocaiubi
thiagocaiubi / Greetings.js
Created January 29, 2011 19:17
Greetings
// requires prototype
var Greetings = Class.create({
initialize: function(who){
window.alert(['Hello ', who, '!'].join(''));
}
});
new Greetings('Tumblr');
@thiagocaiubi
thiagocaiubi / CPF.java
Created March 21, 2011 23:01
CPF Objeto Valor
package valueobject;
import java.io.Serializable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import exception.InvalidCPFException;
public final class CPF implements Serializable {
@thiagocaiubi
thiagocaiubi / big_file.sh
Created April 30, 2011 11:46
writes a big big file
//10Gb
dd if=/dev/random of=out.put bs=1024 count=10000000
#!/bin/bash
PASTEL='{
"Ansi 0 Color" = {
"Blue Component" = 0.3097887;
"Green Component" = 0.3097887;
"Red Component" = 0.3097887;
};
"Ansi 1 Color" = {
"Blue Component" = 0.3764706;
@thiagocaiubi
thiagocaiubi / gist:996888
Created May 28, 2011 14:04 — forked from theleoborges/gist:996758
A few useful git commands
#undo last commit
git reset HEAD^
#show files in a given commit
git show --pretty="format:" --name-only rev_number
#remove untracked files and directories
git clean -f -d
#track remote branch
@thiagocaiubi
thiagocaiubi / show-branch.sh
Created June 10, 2011 18:29
Mostra o nome do branch atual no console
PS1='\[\033[38m\]\u@\h\[\033[01;34m\] \w \[\033[31m\]`git branch 2> /dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"(\" \\\$1 \")\" }"`\[\033[29m\]$\[\033[00m\] '
import br.com.caelum.restfulie.Response;
import br.com.caelum.restfulie.Restfulie;
public class RestfulieClient {
public static void main(String[] args) {
String url = "https://esitef-homologacao.softwareexpress.com.br/e-sitef/iniciarTransacao.se";
Response response = Restfulie.at(url).get();
System.out.println(response.getContent());
Exception in thread "main" br.com.caelum.restfulie.RestfulieException: Unable to execute https://esitef-homologacao.softwareexpress.com.br/e-sitef/iniciarTransacao.se
at br.com.caelum.restfulie.http.apache.ApacheDispatcher.execute(ApacheDispatcher.java:138)
at br.com.caelum.restfulie.http.apache.ApacheDispatcher.access(ApacheDispatcher.java:104)
at br.com.caelum.restfulie.http.apache.ApacheDispatcher.process(ApacheDispatcher.java:52)
at br.com.caelum.restfulie.request.RequestStack.process(RequestStack.java:38)
at br.com.caelum.restfulie.request.RequestChain.next(RequestChain.java:20)
at br.com.caelum.restfulie.request.RequestStack.process(RequestStack.java:29)
at br.com.caelum.restfulie.http.DefaultHttpRequest.access(DefaultHttpRequest.java:103)
at br.com.caelum.restfulie.http.DefaultHttpRequest.retrieve(DefaultHttpRequest.java:61)
at br.com.caelum.restfulie.http.DefaultHttpRequest.get(DefaultHttpRequest.java:57)
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
3|Valor invalido:null| |