Skip to content

Instantly share code, notes, and snippets.

View aazbeltran's full-sized avatar
💻
Writing Code..

Alonso ZB aazbeltran

💻
Writing Code..
View GitHub Profile
if(typeof jQuery=="undefined"){function loadScript(url,callback){var head=document.getElementsByTagName('head')[0];var script=document.createElement('script');script.type='text/javascript';script.src=url;script.onreadystatechange=callback;script.onload=callback;head.appendChild(script)}loadScript("https://code.jquery.com/jquery-2.1.3.min.js",x)}else{x()}function x(){var alertx="";$(".datadisplaytable a").map(function(){var $this=$(this);$.ajax({async:false,url:$this.attr("href"),success:function(a){var datadisplaytable=$(".datadisplaytable",a);alertx+="\n\n"+$(".ntdefault",$("tbody",datadisplaytable.get(0)).children(0).get(4)).text()+"\n";$("tbody",datadisplaytable.get(1)).children(0).map(function(a,b){if(a!=0){var td=$("td",b);alertx+=$(td[0]).text().split(" - ")[1]+" => "+$(td[1]).text()+"\n"}})}})});alert(alertx)}
@aazbeltran
aazbeltran / index.html
Created April 1, 2015 15:07
Modal sobre Modal
<script>
$('#modal2').on('show.bs.modal', function() {
$('#modal1').css('opacity', .5);
$('#modal1').unbind();
});
$('#modal2').on('hidden.bs.modal', function() {
$('#modal1').css('opacity', 1);
$('#modal1').removeData("modal").modal({});
});
</script>
@aazbeltran
aazbeltran / Excel.php
Last active August 29, 2015 14:24
Clase Excel para el manejo de PHPExcel
<?php
class Excel {
private $excel;
public function __construct() {
require_once APPPATH.'third_party/phpexcel/PHPExcel.php';
$this->excel = new PHPExcel();
}
@aazbeltran
aazbeltran / MSDN-licences.js
Last active August 29, 2015 14:24
Script para generar el límite diario de licencias en Microsoft MSDN
/*
MSDN Licences generator.
Alonso Alejandro Zúñiga Beltrán 2015
*/
var traducciones={
es:{
startProcess:"Inició proceso",
hostValidation:"Este script sólo funciona en la pestaña de claves de productos de msdn.microsoft.com",
dailyLimit:"Ya se llegó al límite diario."
}
@aazbeltran
aazbeltran / PRIME.CARD_KEY.BF.js
Created August 16, 2015 07:13
card key PIU PRIME BRUTE FORCE
card_key = 1111111111111111;
bandera=true;
intervaloPIU = function() {
var card_keyStr = card_key.toString();
$("form[name=frmCard] input[name='cardkey1']").val(card_keyStr.substring(0, 4));
$("form[name=frmCard] input[name='cardkey2']").val(card_keyStr.substring(4, 8));
$("form[name=frmCard] input[name='cardkey3']").val(card_keyStr.substring(8, 12));
$("form[name=frmCard] input[name='cardkey4']").val(card_keyStr.substring(12, 16));
var string = $("form[name=frmCard]").serialize();
$.ajax({
* {
font-family: Arial, "Free Sans";
}
#container {
color: #fff;
background: #000;
}
#container #question {
display: block;
padding: 20px;
@aazbeltran
aazbeltran / Coord2DMS.js
Created October 7, 2015 17:51
Convertir coordenadas de Google Maps a Grados, Minutos y Segundos para Bestel
function Coord2DMS(lat, long) {
var sLong = 1;
if (long < 0) {
sLong = -1;
long = long * -1;
}
var long_deg = Math.floor(long);
var long_min = Math.floor((long - Math.floor(long)) * 60);
var long_sec = Math.round((((long - Math.floor(long)) * 60) - Math.floor(((long - Math.floor(long)) * 60))) * 60 * 1000) / 1000;
long = [(long_deg * sLong).toFixed(3), long_min.toFixed(3), long_sec.toFixed(3)];
@aazbeltran
aazbeltran / cp.json
Created October 9, 2015 15:49
Obtener todos los códigos postales de México desde INEGI
This file has been truncated, but you can view the full file.
{"1000":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1010":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1020":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1028":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1029":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1030":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1040":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1048":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1049":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1050":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1060":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1070":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1080":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1089":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1090":{"MUNICIPIO":"ÁLVARO OBREGÓN","ESTADO":"DISTRITO FEDERAL"},"1100":{"MUNICIPIO":"ÁLVARO OBREG
@aazbeltran
aazbeltran / scl-clienteunico.js
Last active October 20, 2015 18:17
Introducir automáticamente Cliente Único en el Sistema General de Cobranza
if (typeof introducirClienteUnico != 'function') {
function introducirClienteUnico() {
try {
if (location.hostname.match(/sclpcj\.com\.mx/) == null) throw "Esta herramienta está diseñada para funcionar únicamente en SCL.";
var CLIENTEUNICO = prompt("Por favor ingrese el cliente único a mostrar.");
if (CLIENTEUNICO == null) return;
CLIENTEUNICO = CLIENTEUNICO.replace(/\s/g, "");
var iframe = document.getElementsByTagName('iframe')[0].contentDocument;
CLIENTEUNICO.match(/([0-9]*)-([0-9]*)-([0-9]*)-([0-9]*)/);
if (RegExp.$1 == "" || RegExp.$2 == "" || RegExp.$3 == "" || RegExp.$4 == "") throw "Favor de escribir un Cliente único válido";
@aazbeltran
aazbeltran / index.js
Created September 10, 2016 19:07
Obtener uri handler con bundle id de AppStore
var bundles=["net.whatsapp.WhatsApp"];
bundles.map(function(bundle){
$.getJSON( "http://itunes.apple.com/lookup?country=mx&bundleId="+bundle, function(res) {
if(res.resultCount==0){
console.log("404 - "+bundle);
return;
}
console.log(res.results[0].trackViewUrl.replace("https","itms-apps"));