Skip to content

Instantly share code, notes, and snippets.

View luizrobertofreitas's full-sized avatar

Luiz Roberto Freitas luizrobertofreitas

View GitHub Profile
@luizrobertofreitas
luizrobertofreitas / mave-sonar-config
Created May 19, 2014 03:39
Maven + Sonar Configuration
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Example for MySQL-->
<sonar.jdbc.url>
jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&amp;characterEncoding=utf8
</sonar.jdbc.url>
@luizrobertofreitas
luizrobertofreitas / create_oracle_dblink
Created May 26, 2014 12:38
Create oracle database link example
@luizrobertofreitas
luizrobertofreitas / maven-weblogic-deployment
Last active August 29, 2015 14:03
Maven ant plugin for weblogic deployment
Using maven ant plugin for weblogic deployment. First, configure your pom.xml as below. Try the following maven command to execute the plugin goal:
mvn clean package antrun:run
Configuration:
<build>
<finalName>artifactName</finalName>
<plugins>
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="order-old" transaction-type="RESOURCE_LOCAL">
<class>model.Order</class>
<class>model.OrderLine</class>
<class>model.Customer</class>
<properties>
<!-- Change this to access your own database. -->
@luizrobertofreitas
luizrobertofreitas / mysql-database-encoding
Created August 31, 2014 22:22
Alter mysql database collation and character
ALTER DATABASE app DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
@luizrobertofreitas
luizrobertofreitas / af_inputDate_hack
Created January 20, 2015 16:37
Change the default time picker in the af:inputDate popup
$(document).ready(function () {
var inputDateCurrentId = '';
$("a[id$='idEndDt\\:\\:glyph']").click(function(evt) {
inputDateCurrentId = 'idEndDt';
});
$("a[id$='idStartDt\\:\\:glyph']").click(function(evt) {
inputDateCurrentId = 'idStartDt';
@luizrobertofreitas
luizrobertofreitas / steps-mysql-ds-wildfly
Created July 27, 2015 19:24
Steps to add a MySQL Datasource on Wildfly 8.2
First: http://giordanomaestro.blogspot.com.br/2015/02/install-jdbc-driver-on-wildfly.html
Second: http://blog.squins.com/2014/12/adding-a-mysql-jndi-datasource-to-jboss-wildfly-via-cli/
@luizrobertofreitas
luizrobertofreitas / gist:5196392
Created March 19, 2013 14:09
JavaScript: Beautiful modal confirmation for RoR
/* Overriding custom rails on delete action to provide a more beautiful modal confirmation */
this.extendOnDeleteRailsAction = function() {
$.rails.allowAction = function(element) {
var $link, $modal_html, message, modal_html;
message = element.data('confirm');
if (!message) {
return true;
}
<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>com.projectboard</groupId>
<artifactId>projectboard</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Project Board</name>
<description>Project management dashboard.</description>
@luizrobertofreitas
luizrobertofreitas / gist:5472888
Created April 27, 2013 12:09
Postgresql interesting commands (for CLI only ;-) )
1 - Logging as postgress
$ sudo su - postgres
2 - Creating a new user
$ createuser user
3 - Changing/Setting user password