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 twython import TwythonStreamer | |
APP_KEY = '<your app key>' | |
APP_SECRET = '<your app secret>' | |
OAUTH_TOKEN = '<your oauth token>' | |
OAUTH_TOKEN_SECRET = '<your oauth secret>' | |
""" |
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 django import http | |
from django.core import serializers | |
from django.utils import simplejson as json | |
class JSONResponseMixin(object): | |
""" | |
Mixin to send a json response. It serialize the context variable into | |
a JSON object which can be sent to the browser or used as a service. |
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 __future__ import division | |
def addcomas(n, sep=1000): | |
cad = '' | |
if n < sep: | |
return n | |
while(n > 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
# -*- coding:utf-8 -*- | |
# [2015-10-19] Challenge #237 [Easy] Broken Keyboard | |
# https://www.reddit.com/r/dailyprogrammer/comments/3pcb3i/20151019_challenge_237_easy_broken_keyboard/ | |
def return_word(s, words): | |
s = set(s) | |
result = '' | |
for word in words: | |
if s.issuperset(word): |
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:utf8 -*- | |
# [2015-11-02] Challenge #239 [Easy] A Game of Threes | |
# https://www.reddit.com/r/dailyprogrammer/comments/3r7wxz/20151102_challenge_239_easy_a_game_of_threes/ | |
def test_n(n): | |
if n % 3 == 0: | |
return 0 | |
else: | |
if n % 3 == 1: |
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 base64 | |
import os | |
from django.conf import settings | |
from zeep import Client as ZeepClient | |
from suds.client import Client as SudsClient | |
from pac_gateway.cfd.models import Location |
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 time | |
import sys | |
for progress in range(100): | |
time.sleep(0.1) | |
sys.stdout.write("Download progress: %d%% \r" % (progress) ) | |
sys.stdout.flush() |
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
8prm5p6eeuiY_vHSGXmxIoYHQ13wsTeRqoO1n3udxDw= |
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
(dp0\nS'message'\np1\nS'gAAAAABbrRoVAIZl4D9FghvTEWXu5Ij2-EWTrDAsQsy6tpoj0kd8HXjW89DER0HUZbQWdEoYhYAK4-r9jMz0n-rRs98iwAvNG-LcuulH8IyOwalvjcRh53bQJ0K-KSVNWPWogKsDM_v3'\np2\ns. |
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 pickles | |
import request | |
from cryptography.fernet import Fernet | |
# Instrucciones: | |
# | |
# Ejecutar el programa y enviar el resultado como "Asunto" a: lsantana@ambit.com.mx |
OlderNewer