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
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 / 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;
}
package entities;
public class SubClass extends SuperClass {
private int attribute;
public int getAttribute() {
return attribute;
}
}
@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])
@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 / 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 / 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 / formsubmit.js
Created January 10, 2014 14:03
como enviar um post por ajax tratando o retorno. Evitando assim o redirecioanmento do browser
$('#formid').on('submit', function(event) {
event.preventDefault();
var $form = $(this);
var url = $form.attr('action');
$.post( url, $form.serialize())
.done( function(data) {
//trata caso tenha voltado um codigo 200
})
.fail( function( ajx, sc) {
alert("problemas durante a requisição.\n" + sc); });
@heat
heat / css_resources.md
Created December 19, 2013 11:52 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@heat
heat / python_resources.md
Created December 19, 2013 11:52 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides