This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$manager_strings['Bem_Vindo'] = 'Bem vindo ao meu site, %s'; | |
$manager_strings['Noticias_introducao'] = 'Quanto é %s + %s + %s?'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function base62_encode($num){ | |
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$base = 62; | |
$result = ''; | |
while($num >= $base) { | |
$r = $num%$base; | |
$result = $chars[$r].$result; | |
$num = $num/$base; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function codificar($valor, $chave){ | |
if (($chave = codificacao_chave($chave)) !== false){ | |
list($inicio, $fim) = $chave; | |
} else { | |
return false; | |
} | |
$base = base64_encode($valor); | |
$base = str_replace('=', '', $base); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
db_host="localhost" | |
db_name="database" | |
db_user="root" | |
db_pass="" | |
file_path="/full/path" | |
while read LINE; do | |
HASH=`echo $LINE | awk '{print $1}'` | |
FILE=`echo $LINE | awk '{print $2}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FilesMatch "\.(html|htm|js|css|gif|jpg|png)$"> | |
FileETag None | |
<IfModule mod_headers.c> | |
Header unset ETag | |
Header unset Last-Modified | |
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" | |
Header set Cache-Control "public" | |
</IfModule> | |
</FilesMatch> | |
<IfModule mod_deflate.c> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def shuffle! | |
size.downto(1) { |n| push delete_at(rand(n)) } | |
self | |
end | |
end | |
require 'rubygems' | |
require 'twibot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('default_charset', 'utf-8'); | |
header('Content-type: application/xml'); | |
$html = utf8_encode(file_get_contents("http://www.clicrbs.com.br/atlantidafm/jsp/default.jsp?uf=1&local=1&template=3343.dwt&pSection=726§ion=12")); | |
// Tenho vergonha, mas foi o jeito para o lixo de HTML | |
preg_match_all(("/» Pretinho das (.*)<!-- Escutar--><!-- Baixar--> | <a/"), ($html), $matches); | |
$matches = explode("»", $matches[0][0]); |
OlderNewer