This file contains hidden or 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
# Removendo porcarias | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
# Git | |
git :init | |
file(".gitignore") do | |
<<-EOF |
This file contains hidden or 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
// http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links | |
$(document).ready(function() { | |
$('#extlinks a').filter(function() { | |
return this.hostname && this.hostname !== location.hostname; | |
}).after(' <img src="/images/external.png" alt="external link"/>'); | |
}); |
This file contains hidden or 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
set :application, "myapp" | |
set :keep_releases, 5 | |
# git options | |
set :scm, "git" | |
set :repository, "git://github.com/georgeguimaraes/myapp.git" | |
set :branch, "master" | |
set :deploy_via, :remote_cache | |
# deploy credentials |
This file contains hidden or 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 | |
$useCache = true; | |
if ($useCache){ | |
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI']!="/"){ | |
$cacheName=str_replace('/','-',$_SERVER['REQUEST_URI']); | |
$cacheName = substr($cacheName,1); | |
}else{ | |
$cacheName='site-index.html'; | |
} | |
$cacheFile = "cache/{$cacheName}"; |
This file contains hidden or 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]); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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); |