Skip to content

Instantly share code, notes, and snippets.

View giraam's full-sized avatar

Gilberto Ramos giraam

View GitHub Profile
@giraam
giraam / oracle-validate-email.sql
Last active December 28, 2015 07:49
Retrieve only valid email addresses from a query in Oracle
SELECT NVL(LOWER(T.EMAIL),'-')EMAIL
FROM TABLE_NAME T
WHERE REGEXP_LIKE(NVL(LOWER(T.EMAIL),'-'), '^[a-zA-Z0-9!#$%''\*\+-/=\?^_`\{|\}~]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,4}$');
@giraam
giraam / generate-random-seed.java
Last active December 28, 2015 00:29
Generate random seed specifying length in bytes unit
import java.util.Random;
import javax.xml.bind.DatatypeConverter;
/**
* Generate random seed
*
* @param seedlength Seed length in bytes unit
* @return seed
*/
public String generateSeed(int seedlength) {
@giraam
giraam / string-to-sha1.java
Last active May 17, 2023 17:55
Hashing a String with SHA1 in Java
import java.io.*;
import java.util.logging.*;
import javax.xml.bind.DatatypeConverter;
/**
* Hashing with SHA1
*
* @param input String to hash
* @return String hashed
*/