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
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) {
/**
* Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package br.com.caelum.vraptor.benchmark;
import java.lang.invoke.MethodHandle;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;