obtener tipo de archivo de cadena en base64

17 12 2019
$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 "";
} 
efectivamente le falta un poco de sofisticación (para cuando la cadena si contenga al inicio el tipo de archivo)





cadena hexadecimal aleatoria

8 09 2019

var 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





agregar un nodo de HTML a una lista de nodos

5 04 2018

DOMDocumentFragments 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-&gt;createDocumentFragment();
   $frag-&gt;appendXML($newHTML);
   $oldnode-&gt;appendChild($frag);
   $updatedHTML=$domdocument-&gt;saveHTML();
 }

ex: http://multiple.webcindario.com/addNodefromHTML.php
(Agrega un párrafo como chilNode de los Nodos originales)

https://stackoverflow.com/questions/14839879/create-a-domnode-from-a-string-of-an-html-fragment/46781265#46781265





como estropear y luego recuperar un motorola i465

31 03 2018

Nada 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.





redeemRedirect

4 11 2016

Para 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 &quot;llinks&quot; to select from all the links in the page the ones than match with given array values, every single key is splitted in &quot;tags&quot;; 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 &lt; llinks.length; n++) {		llinks[n] = llinks[n].toLowerCase().split(&quot; &quot;);}//items array into 2d tags array
// global object
var gLockerzLinkchecker = {
	links: [],        // link objects
	GREEN: &quot;#7CFC00&quot;, // some color definitions
	RED:   &quot;#FF6347&quot;,
	YELLOW: &quot;yellow&quot;,
	ORANGE: &quot;orange&quot;,
	GREY:  &quot;silver&quot;,
	populate: function() {
		var btn = document.getElementById(&quot;gm_lockerz_lichckr_btn&quot;);
		btn.setAttribute(&quot;value&quot;, &quot;Stop&quot;);
		var ll = document.getElementsByTagName(&quot;a&quot;);
		for (var j = 0; j &lt; llinks.length; j++) {//links order according to list, not order of the page
			for (var i = 0; i &lt; ll.length; i++) {
				var l = ll[i];
				href = l.getAttribute(&quot;href&quot;);
				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(&quot; &quot;);//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(&quot;gm_lockerz_lichckr_btn&quot;);
		btn.setAttribute(&quot;value&quot;, &quot;Initializing...&quot;);
		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(&quot;gm_lockerz_lichckr_btn&quot;);
		btn.setAttribute(&quot;value&quot;, &quot;Start&quot;);
		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;

		// &quot;start&quot; button on page
		var ovl = document.createElement(&quot;input&quot;);
		ovl.setAttribute(&quot;id&quot;, &quot;gm_lockerz_lichckr_btn&quot;);
		ovl.setAttribute(&quot;type&quot;, &quot;button&quot;);
		ovl.setAttribute(&quot;value&quot;, &quot;Check links&quot;);
		ovl.style.position = &quot;fixed&quot;;
		ovl.style.zIndex = 99999; // insane, sometimes needed though
		ovl.style.top = &quot;12px&quot;;
		ovl.style.right = &quot;8px&quot;;
		ovl.style.backgroundColor = gLockerzLinkchecker.GREEN;
		ovl.addEventListener('click', gLockerzLinkchecker.evtStart, true);
		document.getElementsByTagName(&quot;body&quot;)[0].appendChild(ovl);

		var logout = document.createElement(&quot;div&quot;);
		logout.setAttribute(&quot;id&quot;, &quot;gm_lockerz_lichckr_log&quot;);
		logout.style.display = &quot;none&quot;;//comment for debug
		logout.style.position = &quot;absolute&quot;;
		logout.style.zIndex = 99998;
		logout.style.top = &quot;50px&quot;;
		logout.style.right = &quot;8px&quot;;
		logout.style.backgroundColor = gLockerzLinkchecker.GREEN;
		document.getElementsByTagName(&quot;body&quot;)[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.





UBIGEO Perú

14 10 2016

Descargue 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





Composición de los electrolitos de uso terapéutico

4 10 2016

Descargue aquí la lista con los electrolitos y sus componentes.

 

 

 

 





CIE10 -ESPAÑOL-

28 09 2016

Descargue 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.