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 | |
$filename= "ejemplo-de-imagen.jpg"; | |
list($w, $h, $type, $attr) = getimagesize($filename); | |
$src_im = imagecreatefromjpeg($filename); | |
$src_x = '0'; // comienza x | |
$src_y = '0'; // comienza y | |
$src_w = '100'; // ancho | |
$src_h = '100'; // alto |
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://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
//alert(diferencia); |
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
var fullDate = new Date() | |
console.log(fullDate); | |
//Thu Otc 15 2014 17:25:38 GMT+1000 {} | |
//convert month to 2 digits | |
var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) :(fullDate.getMonth()+1); | |
var currentDate = fullDate.getDate() + "/" + twoDigitMonth + "/" + fullDate.getFullYear(); | |
console.log(currentDate); | |
//15/10/2014 |
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
var fecha = new Date(); | |
alert("Día: "+fecha.getDate()+"\nMes: "+(fecha.getMonth()+1)+"\nAño: "+fecha.getFullYear()); | |
alert("Hora: "+fecha.getHours()+"\nMinuto: "+fecha.getMinutes()+"\nSegundo: "+fecha.getSeconds()+"\nMilisegundo: "+fecha.getMilliseconds()); | |
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
BANCO CENTRAL se extrae del pdf publicado diariamente | |
http://api.marcos.do/central_bank_rates | |
BANCO POPULAR | |
BANCO LOPEZ DE HARO | |
BANCO DEL PROGRESO | |
BANCON RESERVAS | |
euro_mean and dollar_mean == promedio del todos los banco | |
http://api.marcos.do/rates |
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 | |
// Calcula el numero de dias entre el rango de dos fechas. | |
function convertDateToInteger($dateInit, $dateEnd){ | |
return ((strtotime($dateEnd)-strtotime($dateInit))/86400); | |
} | |
echo convertDateToInteger("09/10/2014","09/14/2014"); | |
?> |
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 | |
function deldir($dir){ | |
$current_dir = opendir($dir); | |
while($entryname = readdir($current_dir)){ | |
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){ | |
deldir("${dir}/${entryname}"); | |
}elseif($entryname != "." and $entryname!=".."){ | |
unlink("${dir}/${entryname}"); | |
} |
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
<style type="text/css"> | |
.zoom{ | |
transition: 1.5s ease; | |
-moz-transition: 1.5s ease; /* Firefox */ | |
-webkit-transition: 1.5s ease; /* Chrome - Safari */ | |
-o-transition: 1.5s ease; /* Opera */ | |
} | |
.zoom:hover{ | |
transform : scale(2); | |
-moz-transform : scale(2); /* Firefox */ |
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
/ Móviles en horizontal o tablets en vertical | |
------------------------------------------------------------------------- / | |
@media (min-width: 768px) { } | |
/ Tablets en horizonal y escritorios normales | |
------------------------------------------------------------------------- / | |
@media (min-width: 1024px) { } | |
/ Escritorios muy anchos |
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 | |
public static function getTasaDolar($from, $to, $amount){ | |
$content = file_get_contents('https://www.google.com/finance/converter?a='.$amount.'&from='.$from.'&to='.$to); | |
$doc = new DOMDocument; | |
@$doc->loadHTML($content); | |
$xpath = new DOMXpath($doc); |