Skip to content

Instantly share code, notes, and snippets.

@renie
renie / tabEngine.js
Created July 2, 2012 17:41
Just the logic, with jquery, for a tab menu( I will convert this in a plugin and improve logic )( WITHOUT STYLE! Stylish by yourself )
$(document).ready(function(){
//if exists a tab menu
if($('.tabsMenu').length > 0){
prepareTabMenu();
}
});
/**
* Prepare elements with function that will be called when clicked
* */
@renie
renie / gist:2776282
Created May 23, 2012 16:42
Function to remove some special unicode chars of an unique string or a strings array
private function _semAcentos($string, $returnFormat = 1){
if(is_array($string)){
for($i=0; $i<count($string); $i++){
$string[$i] = preg_replace("/[áàâãª]/u","a",$string[$i]);
$string[$i] = preg_replace("/[ÁÀÂÃ]/u","A",$string[$i]);
$string[$i] = preg_replace("/[éèê]/u","e",$string[$i]);
@renie
renie / gist:2230445
Created March 28, 2012 20:59
All array values to UTF8 ( recursive, so it works on assiciative array )
function convertArrayToUtf8(array $array) {
$convertedArray = array();
foreach($array as $key => $value) {
if(gettype($key)=='string')
$key = utf8_encode($key);
if(is_array($value))
$value = $this->convertArrayToUtf8($value);
if(gettype($value)=='string')