This file contains hidden or 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 | |
/* connect to gmail */ | |
$hostname = '{email.linc.do:993/imap/ssl/novalidate-cert}INBOX'; | |
$username = '[email protected]'; | |
$password = '593musica'; | |
/* try to connect */ | |
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Linc: ' . imap_last_error()); | |
/* grab emails */ |
This file contains hidden or 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
//Self-Executing Anonymous Function (Función anónima auto-ejecutable) | |
(function(grupo, $, undefined){ | |
// Propiedad privada | |
var PasswordAdministrator = "adivina"; | |
// Propiedades publicas | |
grupo.Nombre = "Developers Dominicanos"; | |
grupo.CantidadMiembros = 0; |
This file contains hidden or 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
-> matches any character | |
+ -> means match 1 or more times | |
* -> means match 0 or more times | |
{5} -> means match {n} times | |
{3,5} -> means 3 or up to 5 times | |
^ -> means NOT | |
[] -> character set | |
\ -> escape a special meaning | |
\s -> represents a space ( matches space, tab or line break ) | |
\w -> represents a word character ( lower or uppercase letter or a number ) |
This file contains hidden or 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 | |
$cadena = file_get_contents('http://www.taringa.net'); | |
function extraerURLs($cadena){ | |
$regex = '/https?\:\/\/[^\" ]+/i'; | |
preg_match_all($regex, $cadena, $partes); | |
return ($partes[0]); | |
} | |
// Llamamos a la función y le pasamos la cadena a buscar |
This file contains hidden or 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
$bytes = disk_free_space("/"); | |
$base = 1024; | |
$libre = ($bytes/$base)/$base; // en MB | |
echo $libre.' MB<br>'; // Imprime por ej: 54477.0546875 MB |
This file contains hidden or 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 validar_dni($dni){ | |
$letra = substr($dni, -1); | |
$numeros = substr($dni, 0, -1); | |
if ( substr("TRWAGMYFPDXBNJZSQVHLCKE", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){ | |
echo 'valido'; | |
}else{ | |
echo 'no valido'; | |
} | |
} | |
This file contains hidden or 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
1. Ocultar esas imagenes: | |
$("img").error(function(){ | |
$(this).hide(); | |
}); | |
2. Reemplazar esas imágenes por una por defecto. | |
$("img").error(function() { | |
$( this ).hide(); |
This file contains hidden or 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
Aquí vemos claramente una imagen en donde si la analizamos con detenimiento y a profundidad podemos observar que a partir de los distintos puntos de discrepancia y comparación se puede llegar a la idea central que se aleja del argumento principal, de lo cual concluimos que este comentario no tiene sentido alguno. |
This file contains hidden or 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
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
<script> | |
$.getJSON('http://api.wipmania.com/jsonp?callback=?', function (data) { | |
alert('País: ' + data.address.country); | |
}); | |
</script> |
This file contains hidden or 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
Problema: | |
The XYZ bacteria is studied by a Harvard student | |
The bacterium is a hermaphrodite, it is able to reproduce itself by him without the intervention of a bacterium of the opposite sex. | |
It has been discovered that under temperate climatic conditions this bacterium is reproduced twice at full life creating two new microbes. | |
A constraint to consider is that, for reasons not yet discovered the first bacteria populations of microbes is replicated five times, creating 5 new microbes. |