Skip to content

Instantly share code, notes, and snippets.

View alexandrebini's full-sized avatar

Alexandre Bini alexandrebini

View GitHub Profile
{
"auto_complete": false,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
% Facts
parent(dirce, gislene).
parent(dirce, irair).
parent(valdemar, gislene).
parent(valdemar, irair).
parent(gislene, alexandre).
parent(gislene, fakebrother).
parent(irair, fernando).
% Rules
yaml = YAML.load_file("#{Rails.root}/config/shopping.yml")
yaml.each do |tab, products|
products.each do |a, values|
tab_name = tab.gsub ' ', '_'
name = values.first.gsub ' ', ''
link = values.last
puts "#{tab_name}: #{name}"
puts "http://clicklogger.rm.uol.com.br/shopping/?prd=239&grp=skin:clickjogos;src:14;size:19;chn:102;pos:4;thm:#{tab_name};creative:#{name}&msr=Cliques%20de%20Origem:1&oper=11&redir=#{ link }"
puts
RewriteCond %{HTTP_USER_AGENT} ^Fly [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^htc [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^HTC [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Huawei [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^HUAWEI [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^INQ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^LENOVO [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^LG [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MAUI [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^mot- [NC,OR]
@alexandrebini
alexandrebini / gist:2837074
Created May 30, 2012 15:41
m.clickjogos.uol.com.br
# m.clickjogos
if ($http_user_agent ~ (^Fly|^htc|^HTC|^Huawei|^HUAWEI|^INQ|^LENOVO|^LG|^MAUI|^mot-|^MOT|^nokia|^NOKIA|^NEC|^Openwave|
^OPENWAVE|^samsung|^SEC|^sgh|^SPH-|^SIE|^Xda|^ZTE|ACS-NF|Amoi|Android|Alcatel|BenQ|BENQ|BlackBerry|
Cellphone|DoCoMo|ericsson|Ericsson|HTC|Hutchison|imode|iPAQ|iPhone|LGE|Maemo|Maui\ Browser|MAUI\ WAP|
MIDP|Mitsu|Mobi|mobile|Mobile|Motorola|NetFront|Netfront|Nintendo\ DSi|nokia|Nokia|Obigo|Palm|
Panasonic|PHILIPS|Phone|PlayStation\ Portable|portalmmm|SAGEM|SAMSUNG|Samsung|SANYO|Sanyo|SCH\-|Sendo|
SHARP|Smartphone|SmartPhone|Symbian\ OS|SymbianOS|Teleca|Toshiba|UP\.Browser|Vodafone|webOS|wap|WAP|Windows\ CE) ) {
rewrite ^(.*) http://m.clickjogos.uol.com.br/ permanent;
}
@alexandrebini
alexandrebini / gist:2772444
Created May 23, 2012 00:04
remove .DS_Store
find ./ -type f | grep .DS_Store | xargs rm
@alexandrebini
alexandrebini / gist:2471019
Created April 23, 2012 13:47
sshfs macos
# http://blog.philippklaus.de/2011/07/sshfs-on-mac-os-x-10-6-8-with-fuse4x/
# http://www.unityisplural.com/2011/11/getting-fuse4x-installed-on-osx-lion.html
xcode-select --switch /Applications/Xcode.app
brew install fuse4x sshfs
sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.10.0/Library/Extensions/fuse4x.kext /Library/Extensions
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
@alexandrebini
alexandrebini / pagseguro.pt-BR.yml
Created September 17, 2011 17:31
pagseguro.pt-BR.yml
pt-BR:
activemodel:
attributes:
pag_seguro/order:
abandon_url:
address: Endereço
address_city: Cidade
address_complement: Complemento
address_district: Bairro
address_number: Número
@alexandrebini
alexandrebini / gist:1073029
Created July 8, 2011 22:56
get twitter kkey
def index
client = TwitterOAuth::Client.new( :consumer_key => 'key', :consumer_secret => 'key')
if session['token'].blank?
session['token'] = client.request_token(:oauth_callback => 'http://127.0.0.1:8000')
end
request_token = session['token']
if params['oauth_token'].blank?
redirect_to request_token.authorize_url
namespace :backup do
task :set_name do
set :backup_folder, "/tmp"
set :backup_name, "#{application}-#{DateTime.now.strftime('%Y-%m-%d_%H-%M-%S')}"
set :backup_path, "#{backup_folder}/#{backup_name}"
end
task :db do
yml = YAML.load_file("#{repository}/config/database.yml")