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
ALLOWED_HOSTS = [‘ip_do_servidor’] | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': ‘revista_virtual’, | |
'USER': ‘mario_chaves’, | |
'PASSWORD': ’s3cr3t3’, | |
'HOST': 'localhost', | |
'PORT': '', |
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 asyncio | |
import random | |
async def slow_action(): | |
await asyncio.sleep(random.randrange(1, 5)) | |
async def my_range(n): | |
i = 0 | |
while i < n: |
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
// Dados após clicar em aplicar (Despesas por funções) | |
const valueFunctions = [ | |
{"value": "adm", "label": "Administração"}, | |
{"value": "jud", "label": "Judiciária"} | |
]; | |
const valueYears = [ | |
{"value": 2007, "label": 2007}, | |
{"value": 2010, "label": 2010} | |
]; |
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 React, {Component} from 'react'; | |
import ReactHighcharts from '../ReactHighcharts'; | |
import Exporting from 'highcharts/modules/exporting.src'; | |
import OfflineExporting from 'highcharts/modules/offline-exporting.src'; | |
import './ExpenseChart.css'; | |
const options = { | |
chart: { | |
type: 'column' | |
}, |
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
{ | |
"navBar": { | |
"name": "AboutBrazil", | |
"menuItems": [ | |
{ | |
"name": "QUEM SOMOS", | |
"link": "#/we-are" | |
}, | |
{ | |
"name": "SERVIÇOS", |
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
/* CREDIT - Jake Archibald, http://www.html5rocks.com/en/tutorials/es6/promises/ */ | |
function get(url) { | |
return new Promise(function(resolve, reject) { | |
var req = new XMLHttpRequest(); | |
req.open('GET', url); | |
req.onload = function() { | |
if (req.status == 200) { | |
resolve(req.response); /* PROMISE RESOLVED */ | |
} else { | |
reject(Error(req.statusText)); /* PROMISE REJECTED */ |
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
# Cadastro de Jogadores | |
In [91]: p1 = 'phelip maia figueredo jorge'.split() | |
In [92]: p2 = 'mario milson joao frota'.split() | |
In [93]: p3 = 'romario bebeto rai ronaldo'.split() | |
In [94]: players = [p1, p2, p3] | |
# Montagem de Times: | |
In [106]: for i, p in enumerate(players): | |
...: ts.append((i + 1, p)) | |
...: |
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 shutil | |
from lxml import html | |
import requests | |
BASE_URL = 'http://www.montenegroleiloes.com.br/' | |
page = requests.get(BASE_URL) | |
tree = html.fromstring(page.content) | |
links_home = tree.xpath('//a[contains(@class, "link_status")]/@href') |
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 requests | |
def get_desc(link): | |
r = requests.get(link) | |
text_list = r.text.split('\n') | |
data = {} | |
for i, t in enumerate(text_list): | |
data['url'] = r.url | |
if '<h4>Lote' in t: |
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 | |
from django.core.urlresolvers import set_urlconf, resolve, reverse | |
from django.conf.urls import url, include | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eventex.settings') | |
def index(request): pass | |
def auth(request): pass |