Skip to content

Instantly share code, notes, and snippets.

View yogonza524's full-sized avatar
:octocat:
Coding..

Gonza yogonza524

:octocat:
Coding..
View GitHub Profile
@yogonza524
yogonza524 / InputMask for Primefaces
Created December 25, 2015 10:57
Here I have my solution for the DateConverter and InputMask
//Basic web page
<div class="card">
<div class="card-content">
<h4 class="grey-text">
Example of input mask with dates
</h4>
<h:form>
<p:growl autoUpdate="true" />
<p:inputMask mask="99-99-9999" value="#{mask.date}" converterMessage="Invalid Date!" converter="dateconverter" />
@yogonza524
yogonza524 / Primefaces Extension for Remote Command
Created December 25, 2015 13:52
Remote command to call javascript to backend
xmlns:pe="http://primefaces.org/ui/extensions"
<h:form id="remoteForm">
<p:growl autoUpdate="true" />
<pe:remoteCommand id="applyDataCommand" name="sayMyName" process="@this" actionListener="#{remote.sayMyName}">
<pe:methodSignature parameters="java.lang.String" />
<pe:methodParam name="name"/>
</pe:remoteCommand>
<p:inputText value="#{remote.name}" immediate="true" id="inputName">
@yogonza524
yogonza524 / password_pattern.txt
Created December 29, 2015 06:32
Java pattern for password
((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%-_.]).{6,32})
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.1-902.jdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
import java.security.MessageDigest;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class TripleDESTest {
private void taskOperation(){
Task<Void> task = new Task<Void>() {
@Override protected Void call() throws Exception {
return null;
}
};
task.setOnSucceeded((WorkerStateEvent event) -> {
//Do some callback action
});
Thread th = new Thread(task);
function Pieza(id, width){
this.s = Snap(id);
this.colorHover = "#B9D1D6";
this.colorBlur = "rgb(236, 240, 241)";
//Methods
var hoverPath = function(path, colorHover, colorBlur){
this.colorHover = colorHover;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DatabaseConnection {
private static DatabaseConnection instance;
private Connection connection;
private String url = "jdbc:postgresql://localhost:5432/jdbc";
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.demo.recentfilelist;
import java.util.ArrayList;
import java.util.List;
sudo -H pip install awsebcli --upgrade --ignore-installed six