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
import os | |
import sqlite3 as sqlite | |
import socket | |
HOST = '' | |
PORT = 1043 | |
BUFSIZE = 1024 | |
ADDR = (HOST,PORT) | |
WORKDIR = '/home/armonge/tmp/whois-python/' |
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
style "imhtml-fix" | |
{ | |
font_name = "Monospace 8" | |
} | |
# Conversation entry box--where you type. | |
widget "*pidgin_conv_entry" style "imhtml-fix" | |
# Conversation history pane--where you read the conversation. | |
widget "*pidgin_conv_imhtml" style "imhtml-fix" |
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 suds.client import Client | |
year = 2012 | |
month = 10 | |
client = Client('https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx?WSDL') | |
for data in client.service.RecuperaTC_Mes(year,month)[0][0]: | |
print u'{fecha}: {valor}'.format(fecha=data['Fecha'], valor=data['Valor']) |
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
import urlparse | |
import re | |
from django.db import models | |
from django import forms | |
def validate_youtube_url(value): | |
'''El patron lo saque de http://stackoverflow.com/questions/2964678/jquery-youtube-url-validation-with-regex''' | |
pattern = r'^http:\/\/(?:www\.)?youtube.com\/watch\?(?=.*v=\w+)(?:\S+)?$' |
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 bs4 import BeautifulSoup | |
from urlparse import parse_qs, urlparse | |
from urlparse import unquote, urlparse, parse_qs | |
from concurrent.futures import ProcessPoolExecutor | |
import urllib | |
import sys | |
video_list = [] | |
sys.setrecursionlimit(10000) |
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
class ProductAdmin(admin.ModelAdmin): | |
list_display = ('name','thumb') | |
def thumb(self, obj): | |
return render_to_string('thumb.html',{ | |
'image': obj.image | |
}) | |
thumb.allow_tags = True |
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
###### NEW: | |
from django.conf.urls.defaults import * | |
from sporty import views | |
urlpatterns = patterns('', | |
url( | |
# 30 characters or fewer. Letters, numbers and @/./+/-/_ characters: | |
r'^users/(?P<username>[a-zA-Z0-9@.+-_]+)/$', |
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
Day job: Web Developer | |
What is your language of choice: Python | |
Open Source contributions: No biggies here, just some patch in https://github.com/mozes/smpp.pdu | |
How do you use GitHub: Mostly i work for organizations that provide me some git repos here, but i also mantain some gists and template django projects i use regularly |
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
Day job: Web Developer in Nicaragua | |
Favorite Python project: Django | |
Favorite Conference: Haven't attended any yet :( | |
Python Experience Level: Intermediate |
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
class TranslatableModelMixin(models.Model): | |
''' | |
Adapted from http://snippets.dzone.com/posts/show/2979 | |
''' | |
language = models.CharField(max_length=2, choices=settings.LANGUAGES, db_index=True) | |
translation_of = models.ForeignKey( | |
to='self', | |
related_name='translation_set', | |
limit_choices_to={'language' : settings.DEFAULT_LANGUAGE}, | |
blank=True, |