Skip to content

Instantly share code, notes, and snippets.

View rponte's full-sized avatar
🏠
Working from home

Rafael Ponte rponte

🏠
Working from home
View GitHub Profile
package fx.time;
import java.sql.Date;
import java.time.LocalDate;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
@Converter(autoApply = true)
public class PersistentLocalDate implements AttributeConverter<LocalDate, Date> {
@rponte
rponte / input.txt
Last active August 29, 2015 14:09 — forked from peczenyj/input.txt
lala
begin
sddasdas
asdasdasd
asdasd
end
lolo
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
@rponte
rponte / hack.sh
Created April 3, 2012 01:29 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
public List<Movimentacao> listaTodasMovimentacoes(Conta conta) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Movimentacao> criteria = cb.createQuery(Movimentacao.class);
Root<Movimentacao> movimentacao = criteria.from(Movimentacao.class);
criteria.where(cb.equal(movimentacao.get(Movimentacao_.conta), conta))
.orderBy(cb.desc(movimentacao.get(Movimentacao_.valor)));
return em.createQuery(criteria).getResultList();
}
@rponte
rponte / mysqlCaseSensitivity
Created June 8, 2012 13:51 — forked from handersonbf/mysqlCaseSensitivity
Case Sensitivity no MySQL
Procure a pasta de instalação do MySQL.
No linux fica em etc/mysql
Abra o arquivo my.cnf como root e procure por essa trecho:
[mysqld]
#
# * Basic Settings
#
#!/bin/sh
# For simplicity's sake I dump this file in the project folder and execute
# it from the VM straight out of /vagrant -> could run as part of box/basebox buildout.
alias apt-get="sudo apt-get"
alias mount="sudo mount"
alias umount="sudo umount"
# Oh. Start by making .vbox_version contain the desired version string.
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
package br.com.smartcoders.easyclinic.components;
import org.springframework.http.HttpStatus;
import br.com.caelum.vraptor.Intercepts;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.InterceptionException;
import br.com.caelum.vraptor.core.InterceptorStack;
import br.com.caelum.vraptor.interceptor.Interceptor;
import br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor;
@Component
public class ApplicationHelper implements ViewHelper {
private final PrettyTimeFormatter formatter;
public ApplicationHelper(PrettyTimeFormatter formatter) {
this.formatter = formatter;
}
public String format(AbstractInstant instant) {