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
" Made by @henriquegogo | |
" Script moved to https://github.com/henriquegogo/dotfiles | |
" I'll maintain this one just for compatibility with old references and history | |
au VimEnter * !wget https://raw.githubusercontent.com/henriquegogo/dotfiles/master/.vimrc -O ~/.vimrc |
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
pt-BR: | |
errors: | |
messages: | |
not_found: "não encontrado" | |
already_confirmed: "já foi confirmado" | |
not_locked: "não está bloqueado" | |
devise: | |
failure: | |
unauthenticated: 'Você precisa logar-se ou cadastrar-se antes de continuar.' |
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
q=0; | |
r = Registro.find(:all, :conditions => ["created_at BETWEEN ? AND ?", Date.new(2010,6,1), Date.new(2010,7,1)]) | |
r.each do |reg| | |
q = (q + reg.quantidade) | |
end | |
puts q |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
click = Nokogiri::HTML(open('http://www.clickon.com.br/clickon-client-http-deal/Fortaleza')) | |
chuchu = Nokogiri::HTML(open('http://www.baratoprachuchu.com.br/')) | |
coletivo = Nokogiri::HTML(open('http://www.baratocoletivo.com.br/')) | |
puts 'Oferta do ClickOn: ' + click.css('.offer a')[0].content.strip() + ' Valor: ' + click.css('.price h2')[0].content.strip() | |
puts 'Oferta do Barato pra Chuchu: ' + chuchu.css('.tituloBanner h3')[0].content.strip() + ' Valor: R$' + chuchu.css('.comparacaoPrecos td:last')[0].content.strip() |
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
from pyquery import PyQuery | |
import urllib | |
#peixe = PyQuery(urllib.urlopen('http://www.peixeurbano.com.br').read()) | |
click = PyQuery(urllib.urlopen('http://www.clickon.com.br/clickon-client-http-deal/Fortaleza').read()) | |
chuchu = PyQuery(urllib.urlopen('http://www.baratoprachuchu.com.br/').read()) | |
coletivo = PyQuery(urllib.urlopen('http://www.baratocoletivo.com.br/').read()) | |
#print 'Oferta do Peixe Urbano: ' + peixe('html').html() | |
print 'Oferta do ClickOn: ' + click('.offer a').html().strip() + ' Valor: ' + click('.price h2').html().strip() |
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
#!/usr/bin/env sh | |
options='--multi-thread -q' | |
while read -n 1 -s key | |
do | |
case $key in | |
0) echo "Kick "; play $options kick.wav &;; | |
4 | 5) play $options hat.wav &;; | |
1 | 2) echo "Snare "; play $options snare.wav &;; |
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
#!/usr/bin/env phyton | |
#-*- encoding: utf8 -*- | |
''' | |
Esse programa vai baixar todas as imagens do SXC | |
e construir um banco de dados com as TAGs de cada | |
imagem. | |
''' | |
import urllib |
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
<script> | |
function ajuda(qual, msg) { | |
var ajudante = document.getElementById("ajudante"); | |
ajudante.style.display = "block"; | |
ajudante.style.top = (qual.offsetTop - 26); | |
ajudante.style.left = qual.offsetLeft; | |
ajudante.innerHTML = msg; | |
} | |
</script> |
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
$('a[data-method="delete"]').click(function(event) { | |
csrf_param = $('meta[name=csrf-param]').attr('content'); | |
csrf_token = $('meta[name=csrf-token]').attr('content'); | |
if (confirm($(this).attr("data-confirm"))) { | |
var attr = {}; | |
attr['_method'] = 'delete'; | |
attr[csrf_param] = csrf_token; | |
$.post(this.href, attr, function() { location.reload(true) }, "script"); | |
} | |
return false; |
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
(function() { | |
var Router = function(routes) { | |
var hash; | |
var splitParams = function() { | |
for (route in routes) { | |
var routeRegex = "^" + route.replace(/:([A-z0-9_-]*)/g, "([A-z0-9_-]*)") + "(/?)$"; | |
var callRoute = routes[route]; | |
var matches = new RegExp(routeRegex).exec(hash); |
OlderNewer