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
public class Fn { | |
public static String strpadLeft ( String cadena, String caracter, int largo ) { | |
if ( cadena.length() < largo ) { | |
largo -= cadena.length(); | |
while ( largo-- > 0) { | |
cadena = caracter + cadena; | |
} | |
} | |
return cadena; |
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
class Debuging { | |
private $filePath; #Ruta del archivo log | |
private $fileName; #Nombre del archivo que invoca el debug | |
/** | |
* Clase de debugeo | |
* @param string $fileName nombre del archivo que invoca la clase | |
* @param string $filePath nombre del archivo donde se almacenará la traza | |
*/ |
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
class MyClass { | |
let nombre:String; | |
init ( nombre:String ) { | |
self.nombre = nombre; | |
} | |
} | |
// Nueva instancia de la clase MyClass | |
let yoMismo = MyClass( nombre:"Cesar Gonzalez" ); | |
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
$(".solo-numero").keyup(function(){ | |
if ($(this).val() != '') | |
$(this).val($(this).attr('value').replace(/[^0-9]/g, "")); | |
}); |
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
/** | |
* Ejemplo de implementación en un campo input que sólo admite 5 dígitos | |
* <input type="text" placeholder="#####" regexp="[0-9]{0,5}" > | |
*/ | |
var UXAPP = UXAPP || {}; | |
// paquete de validaciones | |
UXAPP.validador = {}; |
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
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g,""); | |
} | |
String.prototype.ltrim = function() { | |
return this.replace(/^\s+/,""); | |
} | |
String.prototype.rtrim = function() { | |
return this.replace(/\s+$/,""); | |
} |
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
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class FN { | |
/** | |
* Valida la forma de una dirección de correo | |
* @param email cadena de texto con el email a validar | |
* @return | |
*/ |
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
// Valida la forma del email, no su existencia en un servidor | |
function validaEmail ( $var = '' ) { | |
return preg_match("/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/", $var); | |
} | |
// Ejemplo de uso | |
echo validaEmail ('email@correcto.cl') ? 'Veo que es un bonito e-mail' : 'Esto no es dirección de email!!!'; |
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
// Código actualizado a Swift 3.0.1 | |
print("Esto es para estudio de estructura de datos \n") | |
print("===========================================\n") | |
// Lista enlazada simple | |
// Esto es un objeto para lista enlazada | |
class Nodo { | |
// valor numerico del nodo | |
var valor:Int32! |
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
// Formatea número | |
var fn = { | |
validaEntero : function ( value ) { | |
var RegExPattern = /[0-9]+$/; | |
return RegExPattern.test( value ); | |
}, | |
formateaNumero : function ( value ) { | |
if ( fn.validaEntero ( value ) ) { |
OlderNewer