This file contains 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
# -*- coding: utf-8 -*- | |
import inspect | |
class TransitionObject(object): | |
""" | |
TransitionObject: | |
Uma classe para ajudar nas passagens de transições em fluxos. |
This file contains 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
# Installation | |
wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add - | |
sudo wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/s3tools.list | |
sudo apt-get update && sudo apt-get install s3cmd | |
# Configuration | |
s3cmd --configure |
This file contains 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
# -*- coding: utf-8 -*- | |
from collections import Counter | |
texto = 'Tinha tanta tia tantã Tinha tanta anta antiga, Tinha tanta anta que era tia Tinha tanta tia que era anta' | |
class ContadorPrefixos(object): | |
def __init__(self, prefixos, corpus): |
This file contains 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
// v = verbose | |
// a = archive | |
// z = compress | |
// h = progress | |
rsync -vazh --dry-run --partial -e "ssh -p port" /path/to/local/files/ user@111.111.111.111:/path/to/remote/files/ | |
rsync -vazh --dry-run --partial -e "ssh -p port" user@111.111.111.111:/path/to/remote/files/ /path/to/local/files/ |
This file contains 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
import logging | |
from logging.handlers import RotatingFileHandler | |
LOG_FILENAME = "log_name.log" | |
LOG_LEVEL = logging.INFO | |
log = logging.getLogger("Notifier") | |
log.setLevel(LOG_LEVEL) | |
# Add the log message handler to the logger |
This file contains 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
# -*- coding: utf-8 -*- | |
class MyClass(object): | |
error_msgs = { | |
'integer': "This doesn't look like an integer." | |
} | |
def __init__(self, default=0, raise_errors=True): |
This file contains 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 import forms | |
import datetime | |
class MonthYearWidget(forms.MultiWidget): | |
""" | |
A widget that splits a date into Month/Year with selects. | |
""" |
This file contains 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
.seta{ | |
width: 0; | |
height: 0; | |
} | |
.seta.cima { | |
border-left: 10px solid transparent; | |
border-right: 10px solid transparent; | |
border-bottom: 10px solid #aaa; | |
} |
This file contains 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
# -*- coding: utf-8 -*- | |
import virtualenv, textwrap | |
output = virtualenv.create_bootstrap_script(textwrap.dedent(""" | |
import os, subprocess | |
import urllib2 | |
# YOUR REPO URL ex: | |
REPO = 'https://github.com/arthuralvim/dj-kickstart.git' |
This file contains 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
import random; random.sample(range(1,61),6) |