efectivamente le falta un poco de sofisticación (para cuando la cadena si contenga al inicio el tipo de archivo)$base64String="SUQzAwAAAAAASVRSQ0sAAAACAAAAMVRZRVIAAAAFAAAAMjAxMFRFTkMAAAAkQAAARnJhdW5o";//cadena de ejemplo $data = strtoupper(substr($base64String,0,5)); switch ($data){ case "IVBOR": echo "png"; case "/9J/4": echo "jpg"; case "AAAAF": echo "mp4"; case "JVBER": echo "pdf"; case "AAABA": echo "ico"; case "UMFYI": echo "rar"; case "U1PKC": echo "txt"; case "SUQZA": echo "mp3"; default: echo ""; }
obtener tipo de archivo de cadena en base64
17 12 2019Comentarios : Leave a Comment »
Categorías : php
cadena hexadecimal aleatoria
8 09 2019var rndHEX=Math.random().toString(16);
rndHEX=rndHEX.split(".")[1].match(/(.{1,12})/g)[0];
Solo necesitaba una cadena de 12 caracteres hexadecimales aletorios en javascript
Comentarios : Leave a Comment »
Categorías : General, js
agregar un nodo de HTML a una lista de nodos
5 04 2018DOMDocumentFragments si tiene un método loadXML()
libxml_use_internal_errors(1); $opts = array('http' => array('header' => 'Accept-Charset: ISO-8859-1, *;q=0')); $context = stream_context_create($opts); $html = file_get_contents( 'http://multiple.webcindario.com/wstest.php' , false , $context ); $html = html_entity_decode(htmlentities($html, ENT_QUOTES, 'UTF-8'), ENT_QUOTES , 'ISO-8859-1'); ob_clean(); $classname = "product"; $domdocument = new DOMDocument(); $domdocument->preserveWhiteSpace = true; $domdocument->formatOutput = false; $domdocument->loadHTML($html); $xpath = new DOMXPath($domdocument); $found = $xpath->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' $classname ')]"); $newHTML="<div class='foo bar'><p>This is <b>an <i>example</i></b> paragraph <a href='#!'>#!</a></p></div>"; $newHTML = html_entity_decode(htmlentities($newHTML, ENT_QUOTES, 'UTF-8'), ENT_QUOTES , 'ISO-8859-1'); foreach($found as $oldnode){ $frag = $domdocument->createDocumentFragment(); $frag->appendXML($newHTML); $oldnode->appendChild($frag); $updatedHTML=$domdocument->saveHTML(); }
ex: http://multiple.webcindario.com/addNodefromHTML.php
(Agrega un párrafo como chilNode de los Nodos originales)
Comentarios : Leave a Comment »
Etiquetas: agregar, DOM, DOMDocument, HTML, nodo
Categorías : php
como estropear y luego recuperar un motorola i465
31 03 2018Nada como un obsleto telefono de un carrier que no existe en tu pais.
Primero malogre su flash y luego lo recupere usando, nuevamente, tecnologia obsoleta
los programas fueron difíciles de ubicar y una vez ubicados difíciles de correr. TODO FUNCIONA SOLO EN WINDOWSXP
http://www.mediafire.com/?upzv951587pav
A los foros de reparacion de telefonos; JODANSE, PUDE HACERLO SIN PAGARLES.
Comentarios : 2 Comments »
Etiquetas: boost, flash, motorola i465
Categorías : General
redeemRedirect
4 11 2016Para todos los que estuvieron metidos de lleno en el asunto lockerz, fue común encontrar por pago scripts para greasemonkey, que redireccionaban hacia los premios elegidos durante la redeem (especie de orgía virtual donde se canjeaban puntos por premios físicos(mira el código y veras los premios que alguna vez soné tener), luego abandonada para dar paso a una tienda virtual cualquiera con descuentos).
El detalle esta en la función, que puede ser modificada para el fin que creas útil(que tal usar uno de esos scripts que llena campos automáticamente con esto y comprar lo que sea en por ejemplo ebay cuando valga $1.00 seria loco pero podrías tener un blog basado única y exclusivamente en esta conducta irresponsable).
http://multiple.webcindario.com/works/redeemRedirect.js
/* inspired from linkchecker.user.js 13 2006-05-30 13:05:58Z joe $ Linkchecker - (c) 2006 J.Q. la Poutre LICENSE ======= This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA MODS By FCR */ // ==UserScript== // @name redeemRedirect // @namespace http://about.me/fernandocaldas // @description redirect to selected item on lockerz // @include *.lockerz.* // @version 1.04 // ==/UserScript== llinks = new Array('MacBook 1000 PTZ','MacBook 1750 PTZ','New iPad - 16 GB 1000 PTZ','Dell Inspiron Mini 10 inch- Black','3D Blu Ray','New iPad - 16 GB 2000 PTZ','ELECTRONICS','Original Wayfarer','FORTE - Size 11');//text to match from selected items //note: put the name of the prize in the order you want them: from first option to last option; also, if you add 'BRANDS WE LOVE' or 'ELECTRONICS', you can skip one step :) [but be carefull to chose which boutique to redeem] // this script uses the array "llinks" to select from all the links in the page the ones than match with given array values, every single key is splitted in "tags"; if all the tags match the text in a link, the link will be followed // in order to get JUST what you want, add the PTZ of each item(or have fun searching everything that fits some PTZ price!) hasLink = 0;//match Flag for (var n = 0; n < llinks.length; n++) { llinks[n] = llinks[n].toLowerCase().split(" ");}//items array into 2d tags array // global object var gLockerzLinkchecker = { links: [], // link objects GREEN: "#7CFC00", // some color definitions RED: "#FF6347", YELLOW: "yellow", ORANGE: "orange", GREY: "silver", populate: function() { var btn = document.getElementById("gm_lockerz_lichckr_btn"); btn.setAttribute("value", "Stop"); var ll = document.getElementsByTagName("a"); for (var j = 0; j < llinks.length; j++) {//links order according to list, not order of the page for (var i = 0; i < ll.length; i++) { var l = ll[i]; href = l.getAttribute("href"); linktextOriginal = l.innerHTML; linktext = linktextOriginal.toLowerCase(); var llinksTags = llinks[j]; var matchedTags = 0;//tags array and flag for(var h = 0; h '+llinks[j].join(" ");//log, uncomment for debug if(hasLink==0){location.href=href;hasLink=1;}//redirect to first link, comment for debug } } } gLockerzLinkchecker.evtStop(); }, evtStart: function() { var btn = document.getElementById("gm_lockerz_lichckr_btn"); btn.setAttribute("value", "Initializing..."); btn.style.backgroundColor = gLockerzLinkchecker.ORANGE; btn.removeEventListener('click', gLockerzLinkchecker.evtStart, true); btn.addEventListener('click', gLockerzLinkchecker.evtStop, true); gLockerzLinkchecker.populate(); }, evtStop: function() { var btn = document.getElementById("gm_lockerz_lichckr_btn"); btn.setAttribute("value", "Start"); btn.style.backgroundColor = gLockerzLinkchecker.GREEN; btn.removeEventListener('click', gLockerzLinkchecker.evtStop, true); btn.addEventListener('click', gLockerzLinkchecker.evtStart, true); }, initialize: function() { // work in main window only (too many iframe crap sites, sorry) if (window != top) return; // "start" button on page var ovl = document.createElement("input"); ovl.setAttribute("id", "gm_lockerz_lichckr_btn"); ovl.setAttribute("type", "button"); ovl.setAttribute("value", "Check links"); ovl.style.position = "fixed"; ovl.style.zIndex = 99999; // insane, sometimes needed though ovl.style.top = "12px"; ovl.style.right = "8px"; ovl.style.backgroundColor = gLockerzLinkchecker.GREEN; ovl.addEventListener('click', gLockerzLinkchecker.evtStart, true); document.getElementsByTagName("body")[0].appendChild(ovl); var logout = document.createElement("div"); logout.setAttribute("id", "gm_lockerz_lichckr_log"); logout.style.display = "none";//comment for debug logout.style.position = "absolute"; logout.style.zIndex = 99998; logout.style.top = "50px"; logout.style.right = "8px"; logout.style.backgroundColor = gLockerzLinkchecker.GREEN; document.getElementsByTagName("body")[0].appendChild(logout); //gLockerzLinkchecker.evtStart();//you can skip button clicking by uncommenting this line } }; gLockerzLinkchecker.initialize(); // end user script
que debo hacer con el? instala primero greasemonkey en firefox y luego vuelve a esta pagina y haz click en el vinculo, una vez instalado, debes editarlo para que la lista sea la adecuada.
Que tiene de diferente? busca usando etiquetas, lo que lo hace mejor. algunos pueden criticar el que necesites presionar el boton, pero puedes quitarlo editando el script(super facil de hacer) lo puse por que a veces falla firefox y redirige hacias ruta invalida(tambien intente agregar una coreccion, pero nada está garantizado)
Nota: ofrecido sin garantia alguna.
Comentarios : Leave a Comment »
Categorías : js
UBIGEO Perú
14 10 2016Descargue aquí la relación completa de códigos.
El Código de UBIcación GEOgráfica es usado por el INEI para codificar las circunscripciones territoriales del Perú.
Se compone por 6 digitos con el primer par para el Departamento, el segundo par para el Provincia y el tercer par para el Distrito.
https://es.scribd.com/document/325714673/UBIGEO-Peru
Información recopilada desde INEI
Comentarios : Leave a Comment »
Etiquetas: Códigos postales, departamentos, distritos, INEI, peru, provincias, SERPOST, UBIGEO
Categorías : Uncategorized
Composición de los electrolitos de uso terapéutico
4 10 2016Comentarios : Leave a Comment »
Etiquetas: Calcio, Citrato, Cloruro, composición, electrolitos, Fósforo, ingredientes, Lactato, Magnesio, Potasio, sodio, terapia
Categorías : Uncategorized
CIE10 -ESPAÑOL-
28 09 2016Descargue aquí la versión 10 de la CIE.
https://es.scribd.com/doc/307530908/CIE10
CLASIFICACION ESTADISTICA INTERNACIONAL DE
ENFERMEDADES Y PROBLEMAS RELACIONADOS CON LA SALUD.
DECIMA REVISION. -CIE 10- CODIGOS Y DESCRIPCION A TRES Y
CUATRO DIGITOS.
Comentarios : Leave a Comment »
Etiquetas: Códigos, CIE, CIE10, descargar, ESPAÑOL, leer
Categorías : Uncategorized