Skip to content

Instantly share code, notes, and snippets.

View xombra's full-sized avatar

Hector A. Mantellini xombra

View GitHub Profile
@xombra
xombra / bancos
Last active May 30, 2023 18:16
Codigo y Bancos correspondientes de Venezuela
Banco:
<select name="banco">
<option value=""></option>
<option value="0156">100%BANCO</option>
<option value="0196">ABN AMRO BANK</option>
<option value="0172">BANCAMIGA BANCO MICROFINANCIERO, C.A.</option>
<option value="0171">BANCO ACTIVO BANCO COMERCIAL, C.A.</option>
<option value="0166">BANCO AGRICOLA</option>
<option value="0175">BANCO BICENTENARIO</option>
<option value="0128">BANCO CARONI, C.A. BANCO UNIVERSAL</option>
function SEO_SOCIAL_MEDIA($descripcion,$link,$lang,$titulo,$sitio,$seccion,$fecha,$imagen,$cuentatwitter)
{ $fecha_publicacion = gmdate("Y-m-dTH:i:s-4:30", $fecha); # $fecha en formato unix
echo '
<meta name="description" content="'.$descripcion.'">
<link rel="original-source" href="'.$link.'">
<link rel="canonical" href="'.$link.'">
<meta property="og:locale" content="'.$lang.'">
<meta property="og:type" content="article">
<meta property="og:title" content="'.$titulo.'">
<meta property="og:description"'.$descripcion.'">
@xombra
xombra / get_source
Created April 27, 2014 02:11
Extraer código HTML de un sitio web
function get_source($url,$quitar,$show_headers=0)
{ if(preg_match('!^http://!',$url))
$url=substr($url,7,strlen($url));
if($start=strpos($url,'/')) $uri=substr($url,$start,strlen($url));
else $uri='';
$fp= @fsockopen($url,80,$errno,$errstr,4);
if(!$fp)
{ echo "Imposible conectar $url o no ha indicado URL";
return false;
}
<?php
# Extrae imagenes de un usuario y se filtra por los hastag
#
# Uso:
# Debe crear un archivo .txt de nombre data.txt
# Debe crear una carpeta de nombre grabar
#
/*
@xombra
xombra / apiyoutube.php
Created June 23, 2016 16:35
Video Api Youtube
function API_YOUTUBE($video,$ancho,$alto)
{ ?>
<div class="embed-responsive embed-responsive-16by9 bordevideo">
<script asyn defer>
var tag=document.createElement('script');
tag.src ="https://www.youtube.com/player_api";
var firstScriptTag =document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubePlayerAPIReady(){
@xombra
xombra / validar_email
Created April 26, 2014 01:25
Validar email PHP
function VERIFICA_EMAIL($email){
$email = strtolower(trim($email));
$mail_correcto = 0;
if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")){
if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) {
if (substr_count($email,".")>= 1){
$term_dom = substr(strrchr ($email, '.'),1);
if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ){
$antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
$caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
@xombra
xombra / marca_agua
Created April 26, 2014 03:13
Marca de Agua
$imagen = 'images/img_promos/'.$_GET["imagen"];
$imagen = imagecreatefromjpeg($imagen);
$marca = imagecreatefrompng('images/promo.jpg');
$destino_x = imagesx($imagen);
$destino_y = imagesy($imagen);
$medi_marca_y = imagesy($marca);
$medi_marca_x = imagesx($marca);
$dest_y = 540;
$dest_x = 960;
$calidad = 72;
@xombra
xombra / fontgoogle.js
Last active May 8, 2018 01:44
Cargar font de google en forma asincronica
// Si son varias separar por comas
// en este ejemplo se carga la fuente "lato"
// debe colocarse en el head
// es para no usar
// <link href='https://fonts.googleapis.com/css?family=Lato:400,900,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" async defer>
WebFontConfig={google:{families:['Lato:400,900,700']}};
(function(){var wf=document.createElement('script');
wf.src=('https:'==document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type='text/javascript';wf.async='true';
# extraer la ubicacion (latitud y longitud)
# desde Google Maps
#
function CLIMA($latitud,$longitud)
{ $url = "http://api.openweathermap.org/data/2.5/weather?lat=$latitud&lon=$longitud&units=metric";
# --------------------
$clima = file_get_contents($url);
$json = json_decode($clima);
$temperatura = $json->main->temp;
@xombra
xombra / iCal.php
Created May 6, 2015 13:41
Creacion de iCalendar
<?php
/* -------------------------------------------------------
Script bajo los términos y Licencia
GNU GENERAL PUBLIC LICENSE
Ver Terminos en:
http://www.gnu.org/copyleft/gpl.html
Autor:Hector A. Mantellini (Xombra)