Skip to content

Instantly share code, notes, and snippets.

View heat's full-sized avatar
🌚
Working from home

Onezino Moreira heat

🌚
Working from home
View GitHub Profile
@heat
heat / cake3-crud
Last active August 29, 2015 14:06
error after update cake3
Error: The action index is not defined in controller FiscalsController
Error: Create FiscalsController::index() in file: src\Controller\\FiscalsController.php.
Stack Trace
ROOT\plugins\Crud\src\Controller\ControllerTrait.php line 35 → Cake\Controller\Controller->invokeAction()
*/
public function invokeAction() {
@heat
heat / EntityRepository.java
Created November 5, 2014 14:51
Exemplo de um repositorio de entidade pro java de uma entidade agregadora
public interface EntityRepository<K, E> {
/*
* Para uma base de dados multi-clientes
*/
public List<E> todos(Integer id);
public E busca(K key);
@heat
heat / Entity.java
Last active August 29, 2015 14:13
Exemplo de um objeto simples para retorno de uma consulta generica
public class Entity implements Objectfy {
private String nome;
private String sobrenome;
private Integer idade;
private List<Integer> contatos;
@heat
heat / MapperTest.scala
Created March 27, 2015 13:38
teste de exemplos de mapeadores
import ma.glasnost.orika.MapperFactory
import ma.glasnost.orika.impl.DefaultMapperFactory
import org.specs2.mutable._
class MapperTest() extends Specification {
var mapperFactory: MapperFactory = new DefaultMapperFactory.Builder().build()
"Dado um mappeador "
step {
mapperFactory.classMap(classOf[UmAtributo], classOf[UmAtributoPublic])
package entities;
public class SubClass extends SuperClass {
private int attribute;
public int getAttribute() {
return attribute;
}
}
@heat
heat / Fifa.java
Last active August 29, 2015 14:23
class Jogador {
String nome;
Integer idade;
Bola bola;
public Jogador(String nome, Integer idade) {
this.nome = nome;
this.idade = idade;
}
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.libs.ws._
import play.api.test._
import play.api.test.Helpers._
import scala.concurrent.{ExecutionContext, Await}
@heat
heat / Test.java
Created August 9, 2015 20:35
calling a web
public class IntegrationTest extends WithApplication {
// ...
@Test
public void testRequest() {
Promise<WSResponse> promise = WS.url("http://www.google.com").get();
assertThat(
promise.get(1000).getStatus(), equalTo(OK));
}
import org.junit.*;
import play.libs.ws.WS;
import play.libs.ws.WSResponse;
import play.mvc.*;
import play.test.*;
import play.libs.F.*;
import static play.test.Helpers.*;
import static org.junit.Assert.*;
@heat
heat / gist:1177150
Created August 28, 2011 20:07
last sub-header richfaces style change
<style>
.tabela-alterada .rich-table-subheader th:last-child {
background-color : #fff;
}
</style>
<rich:panel header="teste">
<rich:dataTable value="#{reBeam.alunos}" var="aluno" styleClass="tabela-alterada" >
<f:facet name="header">
<rich:columnGroup>