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 parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
# <rvm_ruby@gemset> (<git branch, if in a git folder>) @ <current path in disk> | |
PS1='\[\e[0;32m\]$(~/.rvm/bin/rvm-prompt i v g) $(parse_git_branch)\[\e[m\] @ \[\e[1;34m\]\w\[\e[m\] \[\e[m\] | |
\[\e[1;32m\]\$ \[\e[m\]\[\e[m\] ' |
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
def parse_data | |
# This is a typical set of parameters passed by Facebook | |
# Parameters: {"signed_request"=>"vsSe9NNeyqom0hAtGyb2L9scc3-aNbY5Xb25EW55LpE.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEzMDA3NzAwMDAsImlzc3VlZF9hdCI6MTMwMDc2NDg2Niwib2F1dGhfdG9rZW4iOiIxNzE2MDQwOTI4NjgwNTd8Mi4xQnBWNm5mU2VXRm5RT0lOdzltNWFRX18uMzYwMC4xMzAwNzcwMDAwLTE1MjAwMzkxfEFpNXctc2t4WlJyVUd1ZzZvOU95aDZBQmdSZyIsInVzZXIiOnsiY291bnRyeSI6InVzIiwibG9jYWxlIjoiZW5fVVMiLCJhZ2UiOnsibWluIjoyMX19LCJ1c2VyX2lkIjoiMTUyMDAzOTEifQ"} | |
# If we have the signed_request parameters, stash them away | |
session[:signed_request] = params[:signed_request] if params[:signed_request] | |
encoded_user_data = session[:signed_request] | |
return if encoded_user_data.blank? | |
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
# Perl-ish solution for the Secret Santas Ruby Quiz (http://rubyquiz.com/quiz2.html) | |
santas = "Luke Skywalker <[email protected]> | |
Leia Skywalker <[email protected]> | |
Gus Portokalos <[email protected]> | |
Toula Portokalos <[email protected]> | |
Bruce Wayne <[email protected]> | |
Virgil Brigman <[email protected]> | |
Lindsey Brigman <[email protected]> | |
".split("\n") |
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
Estamos dando início a um projeto novo, e temos uma a duas vagas pra estágios em desevolvimento. | |
Estou procurando interessados para fazer parte do projeto. | |
As duas vagas pedem por experiência mínima: leia-se noção das tecnologias citadas | |
(obviamente, quanto mais experiência melhor), proatividade e interesse em aprender até a cabeça estourar, | |
trabalhando em um projeto que vai dar o que falar :-) | |
RIA Padawan | |
- Flex e/ou Flash (visual e programação com actionscript) | |
- Java SE (Swing, SWT, JavaFX) |
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
# Configuração do Sphinx para partial matching e caracteres acentuados em português | |
production: | |
enable_star: 1 | |
min_infix_len: 2 | |
charset_table: "\ | |
U+00C0->a, U+00C1->a, U+00C2->a, U+00C3->a, U+00C4->a, U+00E0->a, U+00E1->a, U+00E2->a, U+00E3->a, U+00E4->a, \ | |
U+00C7->c, U+00E7->c, \ | |
U+00C8->e, U+00C9->e, U+00CA->e, U+00CB->e, U+00E8->e, U+00E9->e, U+00EA->e, U+00EB->e, \ | |
U+00CC->i, U+00CD->i, U+00CF->i, U+00EC->i, U+00ED->i, \ | |
U+00D2->o, U+00D3->o, U+00D4->o, U+00D5->o, U+00D6->o, U+00F2->o, U+00F3->o, U+00F4->o, U+00F5->o, U+00F6->o, \ |
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
# String extension to remove non-ascii/graphic accent characters | |
# pt-BR: métodos para remover acentos (e espaços) de String | |
require 'iconv' | |
class String | |
# São José do Poço -> Sao Jose do Poco | |
def remove_non_ascii | |
Iconv.iconv("ASCII//IGNORE//TRANSLIT", "UTF-8", self).join.gsub(/[^a-z._0-9 -]/i, "").tr(".", "_") | |
end | |
NewerOlder