Skip to content

Instantly share code, notes, and snippets.

View ggdio's full-sized avatar
:octocat:
Learning something new

Guilherme Dio ggdio

:octocat:
Learning something new
View GitHub Profile
@ggdio
ggdio / spring-security-mysql-ddl.sql
Created September 17, 2013 20:01
Spring Security DDL Commands for MySQL
create table users (
username varchar(50) not null primary key,
password varchar(50) not null,
enabled boolean not null
) engine = InnoDb;
create table authorities (
username varchar(50) not null,
authority varchar(50) not null,
foreign key (username) references users (username),
@ggdio
ggdio / eclipse-obsidian-theme.epf
Created September 17, 2013 19:59
Obsidian theme for eclipse. Just import on eclipse: File > Import > Preferences > [select this file] > Ok
file_export_version=3.0
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.keyword.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.link.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.tag.enabled=true
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Foreground.SystemDefault=false
/instance/org.epic.perleditor/AbstractTextEditor.Color.Background.SystemDefault=false
/instance/org.epic.perleditor/AbstractTextEditor.Color.Foreground.SystemDefault=false
@ggdio
ggdio / server.xml
Created September 17, 2013 19:55
Tomcat server.xml configuration
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
@ggdio
ggdio / pom.xml
Created September 17, 2013 19:54
Standart POM.xml
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- DADOS -->
<groupId>br.com.ggdio</groupId>
<artifactId>default-example</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
@ggdio
ggdio / Maven Util Commands
Last active December 23, 2015 07:19
'mvn install' command - Generates a pom for non maven project
mvn install:install-file -Dfile=file.jar -DgroupId=br.com.ggdio -DartifactId=artifactId -Dversion=1.0.0 -Dpackaging=jar
@ggdio
ggdio / Maven Convention
Created September 17, 2013 19:53
Maven src folders convetion
src/main/java Application/Library sources
src/main/resources Application/Library resources
src/main/filters Resource filter files
src/main/assembly Assembly descriptors
src/main/config Configuration files
src/main/scripts Application/Library scripts
src/main/webapp Web application sources
src/test/java Test sources
src/test/resources Test resources
src/test/filters Test resource filter files
@ggdio
ggdio / Download.java
Created September 17, 2013 19:51
Util download class for web file response
package br.com.ggdio.gists;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
package br.com.ggdio.gists;
public enum MimeType
{
GIF(".gif","image/gif"),
JPG(".jpg","image/jpg"),
JPEG(".jpeg","image/jpeg"),
BMP(".bmp","image/bmp"),
PNG(".png","image/png"),
DOC(".doc","application/msword"),
@ggdio
ggdio / .gitignore
Created September 17, 2013 19:46
Pre-configured git ignore file for java repos
*.class
# Package Files #
*.jar
*.war
*.ear
# Workspace Metadata #
.metadata/
@ggdio
ggdio / ValidationMessages.properties
Created September 17, 2013 19:43
javax validation messages config file
javax.validation.constraints.AssertFalse.message=The value must be false
javax.validation.constraints.AssertTrue.message=The value must be true
javax.validation.constraints.DecimalMax.message=The value must be less or equal to {value}
javax.validation.constraints.DecimalMin.message=The value must be bigger or equal to {value}
javax.validation.constraints.Max.message=The value max length is {value}
javax.validation.constraints.Min.message=The value min length is {value}
javax.validation.constraints.NotNull.message=It must not be null
javax.validation.constraints.Size.message=The value must be between {min} and {max}