Skip to content

Instantly share code, notes, and snippets.

View Qleoz12's full-sized avatar
🎯
Focusing

qleoz12 Qleoz12

🎯
Focusing
View GitHub Profile
@Qleoz12
Qleoz12 / HibernatePersistenceProviderResolver.java
Last active July 21, 2020 17:45 — forked from jeffsheets/HibernatePersistenceProviderResolver.java
Use JPA 2.1 and Hibernate 4.3.11 on Websphere 8.5.5.x FIX Validate Using
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import javax.persistence.spi.PersistenceProvider;
import javax.persistence.spi.PersistenceProviderResolver;
import javax.persistence.spi.PersistenceProviderResolverHolder;
import java.util.Collections;
import java.util.List;
@Qleoz12
Qleoz12 / pom.xml
Created May 6, 2020 03:48 — forked from rodrik/pom.xml
Sample pom.xml file to enable spring-boot on WAS 8.5.5 running jdk1.6
<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>io.github.rodrik</groupId>
<artifactId>spring-boot-was</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<java.version>1.6</java.version>
</properties>
/**
* SPECIFIC TO XSSF
* This remove all the data validation from a sheet
* @param: pSheet the sheet where it's needed to remove the data validation
*/
public static void removeDataValidation(XSSFSheet pSheet)
{
//Disable the data validation for the sheet
pSheet.getCTWorksheet().unsetDataValidations();
//Enable the data validation for the sheet with no data validation
@Qleoz12
Qleoz12 / vbaValidation.vb
Last active July 22, 2019 16:33
VBA how call funtion on edit cell over a specific range
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox Target.Count
'MsgBox Target.Value
'MsgBox Len(Target.Value)
'MsgBox InRange(Target, Range("A2:A1000"))
If InRange(Target, Range("A2:A1000")) And Target.Count = 1 Then
Call colorValidate(showMatch(Target.Value), Target)
Else
'MsgBox "NO SE EJECUTA"
End If
@Qleoz12
Qleoz12 / Cryptography.java
Created June 20, 2019 20:02 — forked from Diederikjh/Cryptography.java
Single class that handles encryption and decryption with keys using the Android `Keystore` API. Mostly inspired by this [blog post](https://medium.com/@ericfu/securely-storing-secrets-in-an-android-application-501f030ae5a3). This was tested with API 18 and 25 level emulator (and a level 23 device).
package com.example.yourapp;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
import android.support.annotation.RequiresApi;
@Qleoz12
Qleoz12 / index.html
Created April 17, 2019 13:57
html_image_to_b64
<img id="preview" src="http://www.gravatar.com/avatar/0e39d18b89822d1d9871e0d1bc839d06?s=128&d=identicon&r=PG">
<canvas id="myCanvas"/>
public static void waitForPageLoad(WebDriver drv) {
sleep(50); // Make sure new page init has started...
try {
(new WebDriverWait(drv, 5))
.until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
return ((JavascriptExecutor)d).executeScript("return document.readyState").equals("complete");
}
});
} catch (TimeoutException ex) {
@Qleoz12
Qleoz12 / css-comparison.csv
Created January 15, 2019 14:38 — forked from primaryobjects/css-comparison.csv
A comparison of CSS library sizes.
Name Version Size (uncompressed) Size (minified) Size (gzipped) URL
Bootstrap v3.3.7 143 KB 117 KB 20 KB http://getbootstrap.com/css/
Bootstrap v4.0.0 187 KB 147 KB 20 KB https://v4-alpha.getbootstrap.com/
Materialize v3.0 114 KB 90 KB 18 KB http://materializecss.com/
Material Design Lite v1.3.0 350 KB 137 KB 21 KB https://getmdl.io/
mini.css v2.1 47 KB 36 KB 7 KB https://chalarangelo.github.io/mini.css/
Semantic UI v2.2.6 730 KB 550 KB 95 KB https://semantic-ui.com/
Foundation v3.0 90 KB 64 KB 12 KB http://foundation.zurb.com/
Pure CSS v0.6.2 80 KB 17 KB 3.8 KB https://purecss.io/
Picnic CSS v6.3.2 55 KB 38 KB 7 KB https://picnicss.com
For primefaces 6.2 also this worked fine for me
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>5.5.0</version>
</dependency>
and in xhtml file:
<h:outputScript library="webjars" name="font-awesome/5.5.0/js/all.js"/>
*converts
---date
<h:outputText value="#{encuesta.vigencia}" >
<f:convertDateTime type="date" pattern="dd-MM-yyyy"/>ç
</h:outputText>