A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
add-apt-repository ppa:webupd8team/java | |
apt-get update | |
apt-get install oracle-jdk7-installer |
#!/bin/bash | |
# | |
# Install Postgres 9.3, PostGIS and create PostGIS template on an Ubuntu 12.04 Server | |
cd /tmp | |
# add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt) | |
# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list |
add-apt-repository ppa:xubuntu-dev/xfce-4.10 -y | |
add-apt-repository ppa:xubuntu-dev/xfce-4.12 -y | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | |
apt-get update -y | |
apt-get install build-essential -y | |
apt-get install python-dev python-pip python-setuptools -y | |
apt-get install vim curl git -y | |
apt-get install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 libpq-dev postgresql-server-dev-9.3 pgadmin3 -y |
{ | |
"auto_complete": true, | |
"auto_complete_delay": 50, | |
"auto_complete_selector": "source - comment", | |
"auto_complete_size_limit": 4194304, | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "<", | |
"selector": "text.html" |
Linux installation notes (tested under Ubuntu 14.04LTS/12.04LTS), assuming VirtualBox is already installed on host.
# 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: |
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' |
# -*- coding: utf-8 -*- | |
from fabric.api import ( | |
env, | |
serial, | |
settings, | |
sudo, | |
task, | |
warn_only, | |
) |
# -*- 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 |