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
class Batman | |
def detective? | |
true | |
end | |
def looking_at_sign | |
false | |
end |
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
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
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
upstream protest { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out). | |
server unix:/tmp/protest.socket fail_timeout=0; | |
} | |
server { | |
listen 80 default; | |
server_name protest; |
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 time import sleep | |
import tweepy | |
consumer_key= "" | |
consumer_secret= "" | |
access_token= "" | |
access_token_secret= "" |
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
import re | |
def validator(files): | |
pattern = {1: r'',2:r'',3: r'', 4: r'',5: r'',6: r'',7: r'',8: r'',9: r'',10: r'',11: r''} | |
filex = open(files) | |
gen_files = (lists in for lists in filex.readlines()) | |
for gen_list in gen_files: | |
one_list = gen_list.split(";") |
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
import os | |
import shutil | |
import itertools | |
import pyinotify | |
DIR_VERIFY = '/var/log/' | |
DIR_DESTINY = '/home/suporte/' | |
def get_root(find_file): | |
for root, direc, files in os.walk(DIR_VERIFY): |
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 dict_except(func, excp, dici, key): | |
try: | |
rv = func() | |
return rv | |
except excp as e: | |
if key in dici: | |
dici[n] += "-- %s" % str(e) |
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.db import models | |
class PersonManager(models.Manager): | |
def get_by_natural_key(self, first_name, last_name): | |
return self.get(first_name=first_name, last_name=last_name) | |
class Person(models.Model): | |
objects = PersonManager() | |
first_name = models.CharField(max_length=100) |
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
""" | |
Aqui, temos uma Classe Pessoa, onde ela espera receber um nome e sobrenome | |
quando for iniciada | |
""" | |
class Pessoa(object): | |
def __init__(self, nome, sobrenome): | |
self.nome = nome | |
self.sobrenome = sobrenome | |
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
set nocompatible | |
filetype off | |
syntax on | |
set number | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
let mapleader = "," | |
" let Vundle manage Vundle |
OlderNewer