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 get_data($url) { | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; | |
} |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen |
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
window.onbeforeunload = confirmExit; | |
function confirmExit() | |
{ | |
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?"; | |
} |
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 checkDate() { | |
var myDayStr = document.CheckDate.formDate.value; | |
var myMonthStr = document.CheckDate.formMonth.value; | |
var myYearStr = document.CheckDate.formYear.value; | |
var myMonth = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); var myDateStr = myDayStr + ' ' + myMonth[myMonthStr] + ' ' + myYearStr; | |
/* Using form values, create a new date object | |
using the setFullYear function */ | |
var myDate = new Date(); | |
myDate.setFullYear( myYearStr, myMonthStr, myDayStr ); |
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 base64_decode (data) { | |
// http://kevin.vanzonneveld.net | |
// + original by: Tyler Akins (http://rumkin.com) | |
// + improved by: Thunder.m | |
// + input by: Aman Gupta | |
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + bugfixed by: Onno Marsman | |
// + bugfixed by: Pellentesque Malesuada | |
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + input by: Brett Zamir (http://brett-zamir.me) |
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 oNumero(numero){ | |
//Propiedades | |
this.valor = numero || 0 | |
this.dec = -1; | |
//Métodos | |
this.formato = numFormat; | |
this.ponValor = ponValor; | |
//Definición de los métodos | |
function ponValor(cad){ |
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 | |
// Simple Thumb Gen | |
// Por Alex para WebTaller.com | |
$original = imagecreatefromjpeg("original.jpg"); | |
$thumb = imagecreatetruecolor(150,150); // Lo haremos de un tamaño 150x150 | |
$ancho = imagesx($original); | |
$alto = imagesy($original); |
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
int levenshtein (string cad1, string cad2) | |
Esta función devuelve la distancia Levenshtein entre las dos cadenas argumento, | |
ó -1 si alguna de las cadenas tiene más de 255 caracteres. | |
La distancia Levenshtein se define como el mínimo número de caracteres que se | |
tienen que sustituir, insertar o borrar para transformar cad1 en cad2. |
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 oc(a) | |
{ | |
var o = {}; | |
for(var i=0;i<a.length;i++) | |
{ | |
o[a[i]]=''; | |
} | |
return o; | |
} |
OlderNewer