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
window.Clipboard = (function(window, document, navigator) { | |
var textArea, | |
copy; | |
function isOS() { | |
return navigator.userAgent.match(/ipad|iphone/i); | |
} | |
function createTextArea(text) { | |
textArea = document.createElement('textArea'); |
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 apiman.redis import db | |
from datetime import timedelta | |
def set_expiration(data): | |
c = 0 | |
for x in data: | |
if 'analytics' in x: | |
db.expire(x, timedelta(minutes=20)) | |
print(f'Implementada expiração em {c} chaves') |
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 flask_wtf import FlaskForm | |
from wtforms.fields import SelectField | |
def opcoes_UF(): | |
return [ | |
("AC", "Acre"), | |
("AL", "Alagoas"), | |
("AP", "Amapá"), | |
("AM", "Amazonas"), | |
("BA", "Bahia"), |
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
pacientes_alergias = db.Table('pacientes_alergias', | |
db.Column('paciente_id', Integer, ForeignKey('paciente.id'), primary_key=True), | |
db.Column('alergias.id', Integer, ForeignKey('alergias.id'), primary_key=True) | |
) | |
pacientes_doencas = db.Table('pacientes_doencas', | |
db.Column('paciente_id', Integer, ForeignKey('paciente.id'), primary_key=True), | |
db.Column('doencas.id', Integer, ForeignKey('doencas.id'), primary_key=True) | |
) |
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
#import xmlrpclib | |
from xmlrpc import client | |
class ProcessStatus(object): | |
RUNNING = 'RUNNING' | |
STOPPED = 'STOPPED' | |
FATAL = 'FATAL' | |
RESTARTING = 'RESTARTING' | |
SHUTDOWN = 'SHUTDOWN' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ativador - MamboRouter</title> | |
</head> | |
<body> | |
<h1>Insira a hash para ativação</h1><br> | |
<p> | |
<b>Hash</b> <input type="text" placeholder="insira a hash aqui"><br> |
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
# Androidsdk /etc/profile | |
export ANDROID=/opt/android | |
export PATH=$PATH:$ANDROID/tools | |
export PATH=$PATH:$ANDROID/tools/bin | |
export PATH=$PATH:$ANDROID/platform-tools | |
# Nodejs /etc/profile | |
VERSION=v10.16.0 | |
DISTRO=linux-x64 | |
export OPT_RAIZ=/opt |
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
1: Ver versão Django | |
$ python -m django --version | |
2: Criar projeto MySite | |
$ django-admin startproject mysite | |
3: Levantar servidor de desenvolvimento | |
$ python manage.py runserver (opcionl: 8000 ou 8080) | |
4: Criar App Polls |
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
#VENV DOCUMENTAÇÃO | |
1: Instalando | |
$ sudo apt install python3-venv | |
2: Criar diretório do projeto | |
$ mkdir projeto && cd projeto | |
3: Criando ambiente venv dentro do projeto | |
$ python -m venv meuenv |
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
//Function no JavaScript | |
function helloWorld() { | |
console.log("Hello World"); | |
} | |
//Function no EcmaScript | |
const saudacao = () => { | |
const hora = new Date().getHours(); | |
if (hora <= 12) return "Bom dia"; | |
if (hora <= 18) return "Boa tarde"; |
NewerOlder