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
[database] | |
host = localhost | |
dbname = example | |
port = 1234 | |
user = admin | |
password = secret | |
[repository] | |
type = git | |
url = [email protected]:user/project.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
== Instructions == | |
https://docs.djangoproject.com/en/1.4/howto/custom-management-commands/ | |
Commands: | |
- python manage.py sqlproject | |
- python manage.py sqlallproject |
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
Flask==0.9 | |
Flask-Login==0.1.3 | |
Jinja2==2.6 | |
Werkzeug==0.8.3 |
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 string | |
def holes(letter): | |
holes_input = string.ascii_letters | |
holes_output = "1101101000000011100000000012010000000000111100000000" | |
holes_table = maketrans(holes_input, holes_output) | |
return int(letter.translate(holes_table)) | |
def count_holes(text): | |
text = text.replace(' ', '') # Ignore spaces |
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
Após dois anos em apertados 15m², o LHC pretende ir para uma casa maior! | |
Com mais espaço, a diversidade de atividades tende a crescer. Com mais | |
espaço, passamos a ter uma área de convívio com tendências a | |
virar a segunda casa de muita gente. | |
[outros hackerspaces animais.jpg] | |
Pesquisamos várias casas na região de Campinas e encontramos uma que | |
serviu como uma luva! De fácil acesso por transporte público e situada |
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 datetime import datetime | |
from icalendar import Calendar, Event | |
import json | |
import os | |
import urllib2 | |
if __name__ == '__main__': | |
LHC_ICS_FILE = '/home/hscps/hsc.tia.mat.br/lhc.ics' |
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
#!/usr/env/python | |
import re | |
import sys | |
def read_credit_card_data(purchases_file, year, tags=None): | |
with open(purchases_file, 'r') as purchases_data: | |
purchases = purchases_data.readlines() |
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 datetime | |
import os | |
import re | |
import socket | |
import Tkinter as Tk | |
import urllib2 | |
import webbrowser | |
FREE_EBOOK_URL = 'https://www.packtpub.com/packt/offers/free-learning' |
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 datetime | |
import re | |
import urllib2 | |
def today_packtpub_free_ebook(): | |
FREE_EBOOK_URL = 'https://www.packtpub.com/packt/offers/free-learning' | |
try: | |
request = urllib2.Request(FREE_EBOOK_URL) | |
response = urllib2.urlopen(request) | |
except: |
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
def recursive_flatten(nested): | |
"""Return a flatten array from an arbitrarily nested array of integers | |
This function is recursive so it could not be used with lists with high | |
levels of nesting to avoid recursion errors | |
>>> recursive_flatten([]) | |
[] | |
>>> recursive_flatten([1, 2, 3]) |
OlderNewer