This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lala | |
begin | |
sddasdas | |
asdasdasd | |
asdasd | |
end | |
lolo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class ApplicationHelper implements ViewHelper { | |
private final PrettyTimeFormatter formatter; | |
public ApplicationHelper(PrettyTimeFormatter formatter) { | |
this.formatter = formatter; | |
} | |
public String format(AbstractInstant instant) { |
OlderNewer