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
| # 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: |
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 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' |
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 fabric.api import ( | |
| env, | |
| serial, | |
| settings, | |
| sudo, | |
| task, | |
| warn_only, | |
| ) |
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 -*- | |
| import time | |
| from Crypto.Hash import HMAC, SHA256 | |
| class AkamaiSecureToken(object): | |
| """ | |
| Gera um assinatura para ser utilizada junto com o Akamai, para autenticar |
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 -*- | |
| import base64 | |
| import hashlib | |
| import time | |
| HOST = 'localhost' | |
| URL = 'http://{}:1935/'.format(HOST) | |
| STREAM = 'live/myStream' | |
| START_TIME = int(time.time()) |
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 test.py | |
| 4 0 LOAD_CONST 3 ('aaaaaaaaaaaaaaaaaaaa') | |
| 3 STORE_FAST 0 (a) | |
| 5 6 LOAD_CONST 4 ('aaaaaaaaaaaaaaaaaaaa') | |
| 9 STORE_FAST 1 (b) | |
| 7 12 LOAD_FAST 0 (a) | |
| 15 LOAD_FAST 1 (b) | |
| 18 COMPARE_OP 8 (is) |
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 buildpack-deps:jessie | |
| RUN apt-get purge -y python.* | |
| ENV LANG C.UTF-8 | |
| RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ | |
| 26DEA9D4613391EF3E25C9FF0A5B101836580288 | |
| RUN gpg --keyserver pool.sks-keyservers.net --recv-keys \ | |
| 9554F04D7259F04124DE6B476D5A82AC7E37093B \ |
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
| alphabet = { | |
| ".-": "A", | |
| "-...": "B", | |
| "-.-.": "C", | |
| "-..": "D", | |
| ".": "E", | |
| "..-.": "F", | |
| "--.": "G", | |
| "....": "H", | |
| "..": "I", |
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 django.conf import settings | |
| settings.configure( | |
| DEBUG=True, | |
| SECRET_KEY='th1s_1s_s3cr37', | |
| ROOT_URLCONF=__name__, | |
| ) |
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 django.conf.urls import include, url | |
| from django.contrib import admin | |
| # Text to put at the end of each page's <title>. | |
| admin.site.site_title = 'Administração Infobusca' | |
| # Text to put in each page's <h1>. | |
| admin.site.site_header = 'Infobusca' |