This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
str_replace( array("\n", "\r"), '', $STR_TO_REPLACE ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$people = array( | |
array("name"=>"Bob","age"=>8,"colour"=>"red"), | |
array("name"=>"Greg","age"=>12,"colour"=>"blue"), | |
array("name"=>"Andy","age"=>5,"colour"=>"purple") | |
); | |
var_dump($people); | |
$sortArray = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
DROP FUNCTION IF EXISTS `pCase` $$ | |
CREATE DEFINER=`root`@`localhost` FUNCTION `pCase`(str TEXT) RETURNS text CHARSET latin1 | |
DETERMINISTIC | |
BEGIN | |
DECLARE result TEXT default ''; | |
DECLARE word TEXT default ''; | |
DECLARE working_char TEXT default ''; | |
DECLARE last_space INT default 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<script type="text/javascript"> | |
/*credits: http://stackoverflow.com/users/1863794/jltwoo */ | |
/*extends jquery ui widget - creates a new widget tooltipX with the option autoHide*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
FUENTE: https://gist.github.com/eligrey/384583 | |
*/ | |
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkEmail(email) { | |
email = email.toLowerCase(); | |
if(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/.test(email)==false ) { | |
return false; | |
} | |
return t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.toFixedDown = function(digits) { | |
var n = this - Math.pow(10, -digits)/2; | |
n += n / Math.pow(2, 53); // added 1360765523: 17.56.toFixedDown(2) === "17.56" | |
return n.toFixed(digits); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
FUENTE: http://stackoverflow.com/questions/1985260/javascript-array-rotate | |
CREDITOS: http://stackoverflow.com/users/48015/christoph | |
*/ | |
Array.prototype.rotate = (function() { | |
var unshift = Array.prototype.unshift, | |
splice = Array.prototype.splice; | |
return function(count) { | |
var len = this.length >>> 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Modal cargando | |
var dialogs = (function () { | |
var cargandoDiv = $('#cargandoDialog'); | |
var avisoDiv = $('#modalAviso'); | |
return { | |
showCargando: function() { | |
cargandoDiv.modal(); | |
}, | |
hideCargando: function () { | |
cargandoDiv.modal('hide'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Closure para el evitar conflicto de variables, se le pasa el obj jQuery | |
(function ( $ ) { | |
/** | |
* Elimina la clase que empieza con "startsWith" y añade la clase newClass (o no hace nada, si es vacia) | |
* @param {[string]} startsWith string con el que debe comenzar la clase a eliminar | |
* @param {[string]} newClass string con la nueva clase, o string vacio | |
* @return {[jQobj]} Objeto jQuery | |
*/ | |
$.fn.replaceClass = function( startsWith, newClass ) { | |
// A cada uno de los elementos de la selecion ( this ), le aplica la funcion.. |
OlderNewer