Skip to content

Instantly share code, notes, and snippets.

View josecarlosqs's full-sized avatar
🏠
Working from home

José Carlos Q. S. josecarlosqs

🏠
Working from home
View GitHub Profile
<?php
// Replace special chars to a alphabetical equivalent.
// Reemplaza caracteres especiales a un equivalente alfabético.
function alphabetize_special_chars($str){
$chars = array('á','Á','à','À','â','Â','å','Å','ã','Ã','ä','Ä','æ','Æ','ç','Ç','é','É','è','È','ê','Ê','ë','Ë','í','Í','ì','Ì','î','Î','ï','Ï','ñ','Ñ','ó','Ó','ò','Ò','ô','Ô','ø','Ø','õ','Õ','ö','Ö','ß','ú','Ú','ù','Ù','û','Û','ü','Ü','ÿ');
$replacement = array('a','A','a','A','a','A','a','A','a','A','a','A','ae','AE','c','C','e','E','e','E','e','E','e','E','i','I','i','I','i','I','i','I','n','N','o','O','o','O','o','O','o','O','o','O','o','O','B','u','U','u','U','u','U','u','U','y');
$str = str_replace($chars,$replacement,$str);
return preg_replace("/[^a-z0-9]/i", "", $str);
}
@willurd
willurd / web-servers.md
Last active October 26, 2025 20:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000