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
$ LC_ALL='es_MX.UTF-8' python foo.py | |
{'Default locale': ('es_MX', 'UTF-8'), 'Default locale data': ''} | |
{'Current locale data': '', 'Current locale': (None, None)} | |
{'Default locale': ('es_MX', 'UTF-8'), | |
'New locale': ('pt_BR', 'UTF-8'), | |
'New locale data': 'BRL '} | |
{'Current locale data': 'MXN ', 'Current locale': ('es_MX', 'UTF-8')} |
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/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import errno | |
def error(msg): | |
print >> sys.stderr, msg | |
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
Argentina: ['179.61.47.218', '179.63.239.70', '186.0.132.123', '186.18.167.154', '190.103.129.152', '200.0.181.30'] | |
Brazil: ['131.100.239.83', '177.21.69.152', '186.216.188.176', '187.62.201.140', '191.243.240.63', '191.37.252.75'] | |
Chile: ['179.61.104.149', '186.2.255.167', '191.115.207.136', '200.91.7.9', '201.220.121.42', '201.241.15.107'] | |
Costa Rica: ['179.43.29.28', '179.51.207.163', '186.64.202.199', '190.211.94.219', '191.102.59.236', '200.9.209.91'] | |
Dominican Republic: ['148.101.241.245', '190.110.46.230', '190.80.202.106', '190.94.36.245', '200.88.37.156', '66.98.47.231'] | |
Ecuador: ['179.49.20.62', '186.66.244.12', '190.123.51.5', '190.131.18.225', '192.188.59.83', '200.7.76.84'] | |
El Salvador: ['190.53.140.154', '190.53.36.31', '190.57.112.77', '190.57.47.68', '190.87.195.148'] | |
Guatemala: ['181.189.134.7', '186.151.43.15', '191.98.194.76', '200.12.51.204', '200.94.250.180', '207.248.101.171'] | |
Honduras: ['186.179.1.43', '190.109.193.10', '190.15.76.191', '190.211.136.116', '200.107.213.56', '200.107.215. |
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 __future__ import (absolute_import, division, print_function, | |
unicode_literals) | |
from functools import partial, update_wrapper | |
try: | |
from cPickle import dumps | |
except ImportError: | |
from pickle import dumps |
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 step_date_range(start, end, **step): | |
""" | |
Returns a range | |
:param start: datetime | |
:param end: datetime | |
:param step: keywords used in timedelta | |
:return: generator of date ranges | |
>>> list(step_date_range(datetime(2014, 12, 22, 0, 0), |
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
Como nos comportaremos na descida da Rodovia Mogi-Bertioga. | |
A Rod. Mogi-Bertioga é o último trecho dessa rota, mas entretanto tem um problema: falta acostamento no trecho da descida da serra do mar, um trecho de aproximadamente 15km onde 90% é descida mesmo. | |
O trafégo varia de leve a itenso e para descer só há uma pista de rolamento e é sem acostamento, a descida também é intensa. Dai o perigo. | |
Para uma descida segura, vamos nos agrupar em alguns pontos durante a descida. É importante descermos todos juntos. Paradas: | |
1. KM 77, Balança de caminhões, tem restaurante, provavelmente banheiro e com sorte uma bomba para encher pneu ;). | |
2. KM 80, agrupar no km 80 para descermos todos juntos. Depois do KM 80 acaba o acostamento e só teremos áreas de refúgio até o fim da descida. São 13 áreas de refúgio que listo mais abaixo. |
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 DisableMigrations(dict): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES=DisableMigrations() |
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
[felipe@char img_emails]$ python list.py | |
0: ~/img_emails/sample/10000.png > fabio.betti@geopec.it | |
1: ~/img_emails/sample/100000.png > mariofranco.tedde@geopec.it | |
2: ~/img_emails/sample/100001.png > gianfrancoAtedeschi@geopecAit | |
3: ~/img_emails/sample/100002.png > andrea.tedeschi@geopec.it | |
4: ~/img_emails/sample/100004.png > tedeschisrl©pec.it | |
5: ~/img_emails/sample/100006.png > fabio.tedeschi@geopec.it | |
6: ~/img_emails/sample/100007.png > gia nfra nco_tedeschi@ Iegalmail.it | |
7: ~/img_emails/sample/100008.png > gianluca.ted99chi@geopec.it | |
8: ~/img_emails/sample/100009.png > lorenzo.tedeschi@Postacertificata.gov.it |
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
diff -r 7b7bff42522a requirements.txt | |
--- a/requirements.txt Tue Jun 16 12:22:38 2015 -0700 | |
+++ b/requirements.txt Sun Aug 09 14:41:14 2015 -0300 | |
@@ -1,4 +1,4 @@ | |
funcparserlib==0.3.6 | |
mock>=1.0.1 | |
passlib>=1.6.1 | |
-python-ldap>=2.4.10 | |
+pyldap>=2.4.10 | |
diff -r 7b7bff42522a setup.py |
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 template | |
register = template.Library() | |
@register.simple_tag(takes_context=True) | |
def as_active_url(context, url, css_class='active'): | |
""" | |
Usage: | |
{% url 'foobar' as url %} | |
<li class="{% as_active_url url %}"><a href="{{ url }}">URL 1</a></li> |
OlderNewer