Skip to content

Instantly share code, notes, and snippets.

View levymoreira's full-sized avatar

Levy Moreira levymoreira

  • Microsoft
  • Dublin, Ireland
View GitHub Profile
@levymoreira
levymoreira / MavenHibernate
Created June 28, 2011 11:14
Dependências Maven - Hibernate
<!-- antlr-2.7.6 -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.6</version>
</dependency>
<!-- c3p0-0.9.1 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
@levymoreira
levymoreira / PomTest
Created August 2, 2011 13:49
Pom.xml Test
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
@levymoreira
levymoreira / SetupInnoSetupPostgreSql.iss
Created April 12, 2012 19:35
Exemplo Setup (INNO SETUP) instalação PostgreSql no Windows
; Levy Moreira - 12/04/2012
#define MyAppName "Program"
#define MyAppVersion "1.0"
#define MyAppPublisher "NextTi"
#define MyAppURL "http://www.nextti.com/"
#define MyAppExeName "Program.jar"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
@levymoreira
levymoreira / postgresqlpermissao
Created April 25, 2012 14:15
PostgreSQL permissão acesso em 1 minuto
#As alterações abaixo irão dar permissão de acesso total a todas suas bases
#e a todos os usuários remotamente no servidor do postgreSQL então não use em produção.
#Testado no PostgreSQL 9.1
#No arquivo pg_hba.conf
# IPv4 local connections:
host all all 0.0.0.0/0 trust
#No arquivo postgressql.conf
# - Connection Settings -
@levymoreira
levymoreira / gist:5397087
Created April 16, 2013 15:50
Erro mvn exec:java -Dexec.mainClass="org.tfk.Tfk"
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:java (default-cli) on project tfk: An exception occured while executing the Java class. null: InvocationTargetException: Can't find bundle for base name org.tfk.i18n.messages, locale pt_BR -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:java (default-cli) on project tfk: An exception occured while executing the Java class. null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThre
@levymoreira
levymoreira / gist:5425836
Created April 20, 2013 12:29
Alter Locale
/*
* Copyright © 2013 Helio Frota <heliofrota at gmail.com>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
package org.tfk.ui;
import javax.swing.JFrame;
import javax.swing.JButton;
@levymoreira
levymoreira / gist:6536181
Created September 12, 2013 11:50
Open report of iReport with JSF app.
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
FuncUtil.apagarArquivos(request);
String pathJasper = request.getRealPath("WEB-INF/classes/relatorio"); // local onde esta o relatorio
String os = System.getProperty("os.name");
File pasta = new File((os.toLowerCase().indexOf("linux") > -1 ? "/" : "\\"));
pathJasper += pasta;
@levymoreira
levymoreira / gist:10462576
Created April 11, 2014 12:03
Simple php page to receive every month the use confirmation of the program
<?php
//params send by get to page
$companieId = $_GET["id"];
$companieName = $_GET["name"];
//default return
$return = "error";
//database configs
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Postgres AMAZON EC2 -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
@levymoreira
levymoreira / configureDevMachine.sh
Last active August 29, 2015 14:27
This script configure a NodeJs dev machine
########################################################
# This script configure a NodeJs dev machine
# How run?
# 1- Save this text as configureDevMachine.sh at home directory
# 2- Change the variable notRootUser to your user name
# 3- Open terminal and execute
# sudo chmod u+x configureDevMachine.sh
# sudo ./configureDevMachine.sh
########################################################