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 requests | |
import uuid | |
import time | |
import json | |
from random import * | |
import hmac | |
import hashlib | |
import urllib3 | |
import urllib.parse | |
from urllib.parse import urlparse |
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 requests | |
import datetime | |
import operator | |
host = 'https://api.binance.com' | |
priceURL = host + '/api/v3/ticker/price' | |
priceResponse = requests.get(priceURL) | |
priceResponseJSON = priceResponse.json() | |
# {'symbol': 'ETHBTC', 'price': '0.07608700'}: 1 ETH = 0.0760 BTC |
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
#coding: utf-8 | |
from cStringIO import StringIO | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email import Charset | |
from email.generator import Generator | |
import smtplib | |
# Example address data |
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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
from __future__ import print_function | |
import os | |
import sys | |
from wand.image import Image | |
DIMENSIONS = { | |
'OSX': [ | |
('icon_16x16.png', 16), |
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 socket | |
if __name__ == "__main__": | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("localhost", 9000)) | |
data = "some data" | |
sock.sendall(data) | |
result = sock.recv(1024) | |
print result | |
sock.close() |
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 flask import current_app, request, url_for | |
from formencode.htmlfill import render | |
from formencode.api import Invalid | |
from jinja2 import Markup, Undefined | |
from jinja2.exceptions import TemplateSyntaxError | |
from jinja2.ext import Extension | |
from jinja2.nodes import (Const, Filter, FilterBlock, Keyword, Output, | |
TemplateData) | |
from werkzeug.utils import escape |
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
# -*- python -*- | |
# vim: ts=4 sw=4 sts=4 expandtab syntax=python | |
# This is a sample buildmaster config file. It must be installed as | |
# 'master.cfg' in your buildmaster's base directory. | |
# This is the dictionary that the buildmaster pays attention to. We also use | |
# a shorter alias to save typing. | |
import os | |
__basedir__ = os.path.abspath(os.path.dirname(__file__)) |
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
browser = request.user_agent.browser | |
version = request.user_agent.version and int(request.user_agent.version.split('.')[0]) | |
platform = request.user_agent.platform | |
uas = request.user_agent.string | |
if browser and version: | |
if (browser == 'msie' and version < 9) \ | |
or (browser == 'firefox' and version < 4) \ | |
or (platform == 'android' and browser == 'safari' and version < 534) \ | |
or (platform == 'iphone' and browser == 'safari' and version < 7000) \ |
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
#!/usr/bin/env python | |
import sys, os | |
import hashlib | |
import zipfile | |
VENDORS = { | |
# vendor desc : vendor id | |
'Google Inc.' : 'google', | |
'LG Electronics' : 'lge', | |
'Intel Corporation': 'intel_corporation', |
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
#!/usr/bin/python | |
import smtplib | |
SMTP_SERVER = 'smtp.gmail.com' | |
SMTP_PORT = 587 | |
sender = '[email protected]' | |
recipient = '[email protected]' | |
subject = 'Gmail SMTP Test' | |
body = 'blah blah blah' |
NewerOlder