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 to generate a Malvados (http://www.malvados.com.br) feed. | |
# | |
# Author: Dirceu Pereira Tiegs <[email protected]> | |
# | |
# You can see the result on http://dirceu.info/malvados.xml. | |
# | |
require 'rssify' | |
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 django.test import TestCase | |
from django.core import mail | |
from myproject.myapp.views import send_some_emails | |
class FooTestCase(TestCase): | |
def test_email_subject(self): | |
send_some_emails() | |
self.assertEquals(mail.outbox[0].subject, 'My subject') | |
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
ibook:~ dirceu$ # primeiro criamos uma working copy do repositório | |
ibook:~ dirceu$ # isso pode demorar porque o git copia o projeto TODO, | |
ibook:~ dirceu$ # todas as revisões | |
ibook:~ dirceu$ git-svn clone https://dev.xxxxx/projetofoo/trunk projetofoo | |
ibook:~ dirceu$ cd projetofoo | |
ibook:projetofoo dirceu$ # agora é fazer alterações e commits a vontade... | |
ibook:projetofoo dirceu$ vi meuarquivo.py | |
ibook:projetofoo dirceu$ git commit -a -m 'Alterando foo porque bar' | |
ibook:projetofoo dirceu$ # ... e branches! 'git branch NOME' cria um novo branch, | |
ibook:projetofoo dirceu$ # 'git checkout NOME' troca de branch. o branch padrão é 'master' |
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
# Author: Dirceu Pereira Tiegs <[email protected]> | |
# | |
# Script usado para gerar nomes de tavernas | |
# | |
class Array | |
def pick | |
self.sort_by {rand}[0] | |
end | |
end |
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
# Author: Dirceu Pereira Tiegs <[email protected]> | |
# | |
# Script to roll dices (used to play D&D). Example: | |
# | |
# >> require 'dices' | |
# >> 3.d6 | |
# => 10 | |
# >> 3.d6+7 | |
# => 14 | |
# >> 1.d4+2.d8+1.d12+3 |
NewerOlder