Skip to content

Instantly share code, notes, and snippets.

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

Ricardo Duarte rduarte

🏠
Working from home
View GitHub Profile
@rduarte
rduarte / base62.php
Created April 2, 2009 22:34
base62 algorithm - encode and decode
<?php
function base62_encode($num){
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$base = 62;
$result = '';
while($num >= $base) {
$r = $num%$base;
$result = $chars[$r].$result;
$num = $num/$base;
sudo apt-get install php5 php-pear mysql-server php5-gd
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
mkdir ~/www
sudo rm -rf /var/www
sudo ln -s ~/www/ /var/www
$ sudo apt-get update
$ sudo apt-get install linux-backports-modules-intrepid linux-backports-modules-intrepid-generic
$ sudo apt-get remove gnome-orca cdrdao evolution brasero compiz compiz-core libcompizconfig0 compizconfig-backend-gconf compiz-wrapper f-spot transmission-common gnome-pilot libgnome-pilot2 language-pack-en language-pack-gnome-en aspell-en gimp-help-en hunspell-en-us myspell-en-au myspell-en-za myspell-en-gb tracker xsane-common ekiga
Considere a seguinte estrutura de arquivos:
./Carros/
./Carros/1.0/ka.txt
./Carros/1.0/clio.txt
./Carros/1.0/uno.txt
./Carros/1.8/palio.txt
./Carros/2.2/vectra.txt
./Motos/monareta.txt
./Motos/100/biz.txt
./Motos/125/biz.txt
<?php
$manager_strings['Bem_Vindo'] = 'Bem vindo ao meu site, %s';
$manager_strings['Noticias_introducao'] = 'Quanto é %s + %s + %s?';
?>