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
#!/usr/bin/env python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
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
def to_hex(c): | |
r = hex(c[0])[2:].zfill(2)[:2] | |
g = hex(c[1])[2:].zfill(2)[:2] | |
b = hex(c[2])[2:].zfill(2)[:2] | |
return [r, g, b] | |
def get_gradient_color(c1, c2, percent, in_hex=False): | |
r = c1[0] + (percent * (c2[0] - c1[0])) | |
g = c1[1] + (percent * (c2[1] - c1[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
1. Smoke On The Water - Deep Purple ok | |
2. (I Can't Get No) Satisfaction - Rolling Stones ok | |
3. Sunshine Of Your Love - Cream ok | |
4. Layla - Derek And The Dominos ok | |
6. Iron Man - Black Sabbath ok | |
7. Johnny B Goode - Chuck Berry ok | |
8. Heartbreaker - Led Zeppelin ok | |
9. You Really Got Me - The Kinks ok | |
10. Sweet Child O' Mine - Guns N' Roses ok | |
11. Purple Haze - Jimi Hendrix Experience ok |
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 django.forms.widgets import TextInput | |
from django.contrib.db import models | |
import re | |
class TelefoneWidget(TextInput): | |
def __init__(self, attrs=None): | |
attrs_default = {'placeholder': 'xx-(x)xxxx-xxxx', 'maxlength': 13} |
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 django.contrib.auth.decorators import login_required | |
from django.contrib.auth.models import User | |
from django.views.generic.edit import FormMixin | |
from django.views.generic.list import ListView | |
class SearchFormListView(FormMixin, ListView): | |
def get_form_kwargs(self): | |
return {'initial': self.get_initial(), 'data': self.request.GET} | |
def get(self, request, *args, **kwargs): |
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 forms | |
from django.contrib.contenttypes.models import ContentType | |
from generics.models import Documento, Foto | |
class GenericRelationsForm(forms.ModelForm): | |
def __init__(self, *args, **kwargs): | |
self.obj = kwargs.pop('object', None) | |
super(GenericRelationsForm, self).__init__(*args, **kwargs) |
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
#!/usr/bin/env bash | |
cd ~/ | |
sudo apt-get -y install python-software-properties | |
sudo /bin/sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update |
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
*.jpg | |
*.png |
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
#!/usr/bin/env python | |
# ecoding: utf-8 | |
import sys | |
ENCONTRADO = 0 | |
NAO_ENCONTRADO = 1 | |
ERRO = 2 | |
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
""" | |
http://www.gmail.com/g/mail?fr=3&ui=2 | |
http://gmail.com | |
ssh://[email protected] | |
ftp://ime.usp.com.br/~denis/?model=SistemasDeArquivo | |
""" | |
import unittest | |
import string |