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
# -*- encoding: utf-8 -*- | |
import sys | |
from decimal import Decimal | |
try: | |
_juros_mensal = Decimal(sys.argv[3]) | |
except: | |
_juros_mensal = Decimal('1.7') |
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 dados_do_local(endereco): | |
""" | |
Dado o endereco, retorna o endereco processado, a latitude e a longitude do local. | |
Exemplo: | |
place, (lat, lng) = dados_do_local(endereco) | |
""" | |
from geopy import geocoders | |
if hasattr(settings, "EASY_MAPS_GOOGLE_KEY") and settings.EASY_MAPS_GOOGLE_KEY: | |
g = geocoders.Google(settings.EASY_MAPS_GOOGLE_KEY) | |
else: |
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
Prezados, | |
A Storm Security é uma Empresa de Sistemas Críticos e de Segurança da | |
Informação situada no Rio de Janeiro - RJ. Estamos buscando 2 | |
programadores com o seguinte perfil: | |
Características pessoais (o mais importante): | |
- empenhado | |
- organizado |
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
# -*- encoding: utf-8 -*- | |
#Exception Type: UnicodeEncodeError | |
#Exception Value: | |
#'ascii' codec can't encode character u'\xe0' in position 1990: ordinal not in range(128) | |
import uuid | |
from datetime import datetime | |
from django.utils.translation import ugettext_lazy as _ |
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 datetime import time | |
def time_ms(miliseconds=0): | |
'''Return a `time` object with the given num of miliseconds.''' | |
total_micros = miliseconds * 1000 | |
microseconds = total_micros % 1000000 | |
total_seconds = total_micros / 1000000 | |
seconds = total_seconds % 60 |
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.db import models | |
from django.utils import simplejson | |
_NULL = {'blank': True, 'null': True} | |
class Modelo(models.Model): | |
u''' | |
Modelo com metaprogramação baseada no field json_content (oriundo de um webservice) | |
''' |
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
#!/bin/env/python | |
# -*- coding: utf-8 -*- | |
# Author: Ricardo L. Dani | |
# E-mail: ricardodani@gmail.com | |
# Github: http://github.com/ricardodani | |
''' | |
Utility functions for spreadshett manipulation. | |
''' |
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
# TESTING | |
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) |
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
# -*- encoding: utf-8 -*- | |
import requests | |
import sys | |
import time | |
def play_sound(): | |
sys.stdout.write('\a') |
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
class AuthHive(object): | |
''' | |
The AuthHive is the responsible for integrating authentication into your API. | |
''' | |
@classmethod | |
def configure( | |
cls, app, secret_key, expiration=1200, cookie_name='AUTH_TOKEN', | |
authenticated_create=True, authenticated_update=True, | |
authenticated_delete=True, proxy_host=None, proxy_port=None, | |
proxy_username=None, proxy_password=None, authenticated_get=True |
OlderNewer