Skip to content

Instantly share code, notes, and snippets.

View steppat's full-sized avatar

Nico Steppat steppat

View GitHub Profile
@steppat
steppat / gist:4df7e2257d7e10c50a30
Last active August 29, 2015 14:16
Simple RAML file
Obs: http://tinyurl.com/raml-file
-----
#%RAML 0.8
baseUri: http://mocksvc.mulesoft.com/mocks/a296cd19-32ae-4c10-ba8a-ffb527bd4f24
title: pagamentos
version: 1.0
mediaType: application/json
Links para ler sobre a Caelum:
https://www.caelum.com.br/10anos/
https://www.caelum.com.br/faq/
https://www.caelum.com.br/quem-somos/
https://www.caelum.com.br/apostilas/
Outras empresas (fazem parte da Caelum)
http://www.alura.com.br
http://casadocodigo.com.br
@steppat
steppat / gist:701c9084ed96a7a0b017
Created June 23, 2015 21:43
Android HttpURLConnection
try {
URL url = new URL("http://www.caelum.com.br/mobile");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty("Content-type", "application/json");
//coloca o json no corpo do POST
connection.setDoOutput(true);
PrintStream printStream = new PrintStream(connection.getOutputStream());
printStream.println(json);
public class NumeroEAgenciaValidator
implements ConstraintValidator<NumeroEAgencia, Conta> {
public void initialize(NumeroEAgencia anotacao) {
}
public boolean isValid(Conta conta, ConstraintValidatorContext ctx) {
return false;
}
}
#define TAMANHO_MAXIMO_DO_SEGREDO 4
#define REPETICOES_ESTADO_FINAL 3
#define TEMPO_LUZ 1000
#define TEMPO_PAUSA 500
#define ledVerde 2
#define ledAmarelo 3
#define ledVermelho 4
#define ledBranco 5
@steppat
steppat / gist:1286181
Created October 14, 2011 03:30
Simples bean para um formulario JSF
package br.com.caelum.bean;
import javax.faces.component.UIForm;
/*
No faces-config.xml
<managed-bean>
<managed-bean-name>formularioBean</managed-bean-name>
@steppat
steppat / gist:1291637
Created October 17, 2011 00:20
HAProxy config (sticky)
global
daemon
maxconn 256
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
@steppat
steppat / build.xml
Created December 5, 2011 16:14
FJ-31 ANT Build file
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- FJ-31 build file -->
<!-- ======================================================================= -->
<project name="FJ-31" default="ear" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="jboss.home" value="/home/SEU_USUARIO/jboss-6.0.0.Final" />
@steppat
steppat / echoant
Created December 20, 2011 01:12
exemplo echo no build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="compilar" default="empacotar" basedir=".">
<property name="build.dir" value="alguma pasta dentro do projeto" />
<target name="init">
<echo message="Initilzando a construção do projeto" />
<echo message="${build.dir}"/>
</target>
@steppat
steppat / simple build
Created December 20, 2011 02:09
simple build file
<?xml version="1.0" encoding="UTF-8"?>
<project name="argentum" default="executar">
<property file="build.properties" />
<path id="libs.classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>