Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import base64
import hashlib
import time
HOST = 'localhost'
URL = 'http://{}:1935/'.format(HOST)
STREAM = 'live/myStream'
START_TIME = int(time.time())
@dvl
dvl / akamai.py
Last active August 29, 2015 14:27
# -*- coding: utf-8 -*-
import time
from Crypto.Hash import HMAC, SHA256
class AkamaiSecureToken(object):
"""
Gera um assinatura para ser utilizada junto com o Akamai, para autenticar
@dvl
dvl / fabfile.py
Last active September 9, 2015 17:23
# -*- coding: utf-8 -*-
from fabric.api import (
env,
serial,
settings,
sudo,
task,
warn_only,
)
class DummyStorage(FileSystemStorage):
def _open(self, name, mode='rb'):
try:
return File(open(self.path(name), mode))
except IOError:
name = '/home/andre/Imagens/placeholder.jpg'
return File(open(name), mode)
DEFAULT_FILE_STORAGE = 'geral.custom_settings.DummyStorage'
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
@dvl
dvl / README.md
Last active November 5, 2015 06:13 — forked from magnetikonline/README.md
IE 7/8/9/10/11/Edge Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@dvl
dvl / bobp-python.md
Created November 13, 2015 20:03 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@dvl
dvl / stargazers.py
Created March 23, 2016 03:24
Choosing a Go framework with Python...
# -*- coding: utf-8 -*-
import requests
API_URL = 'https://api.github.com/repos/{owner}/{repo}'
client = requests.Session()
client.auth = ('dvl', 'xx')
client.headers.update({
'Accept': 'application/vnd.github.v3+json',
# -*- coding: utf-8 -*-
import mock
import requests
def make_request():
try:
return requests.get('http://httpbin.org/ip').json()['origin']
#!/bin/bash
set -x
EMAIL=''
API_KEY=''
ZONE_ID=''
RECORD_ID=''