Skip to content

Instantly share code, notes, and snippets.

View felipecwb's full-sized avatar
🎧
🚀

Felipe Francisco felipecwb

🎧
🚀
View GitHub Profile
@felipecwb
felipecwb / UUID.php
Last active August 29, 2015 14:21 — forked from dahnielson/UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@felipecwb
felipecwb / stripSpecialChars.sql
Created August 30, 2016 21:24
Replace Special Chars
/** http://stackoverflow.com/questions/12652234/sql-query-to-remove-special-characters **/
DROP FUNCTION IF EXISTS `stripSpecialChars`;
DELIMITER ;;
CREATE FUNCTION `stripSpeciaChars`(`dirty_string` varchar(2048),allow_space TINYINT,allow_number TINYINT,allow_alphabets TINYINT,no_trim TINYINT) RETURNS varchar(2048) CHARSET utf8 DETERMINISTIC
BEGIN
/**
* MySQL function to remove Special characters, Non-ASCII,hidden characters leads to spaces, accents etc
* Downloaded from http://DevZone.co.in
* @param VARCHAR dirty_string : dirty string as input