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
$(document).ready(function() { | |
$('.date-mask').mask('00/00/0000'); | |
$('.date-mask-placeholder').mask('00/00/0000', {placeholder: "__/__/____"}); | |
$('.phone-mask').mask('(00) 00000-0000'); | |
$('.cpf-mask').mask('000.000.000-00'); | |
$('.datepicker').datepicker({ | |
dateFormat: "dd/mm/yy", | |
}); | |
}); |
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
# views.py | |
def get_pacientes(request): | |
if request.GET: | |
q = request.GET.get('term', '') | |
pacientes = Paciente.objects.filter(nome__icontains = q)[:20] | |
results = [] | |
for paciente in pacientes: | |
paciente_json = {} | |
paciente_json['id'] = paciente.id | |
paciente_json['label'] = paciente.nome |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql', | |
'NAME': 'nome do banco', | |
'USER': 'usuário do banco', | |
'PASSWORD': 'senha do usuário do banco', | |
'PORT': 'porta do banco', | |
'HOST': 'host do banco, se a aplicação estiver na mesma máquina pode usar localhost', | |
} | |
} |
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
#forms.py | |
class MyForm(forms.Form): | |
field1 = forms.CharField(label='Field 1') | |
#views.py | |
def my_view(request): | |
if request.method == 'POST': | |
form = MyForm(request.POST) |
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
app.post('/', (request, response) => { | |
response.setHeader('Content-Type', 'application/json'); | |
response.send({message: 'Received!'}) | |
io.emit('emitMessage', request.body) | |
log('\n' + JSON.stringify(request.body)) | |
}) |
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
Error | |
at readStream (/home/francisco/dev/projects/monitor/node_modules/raw-body/index.js:196:17) | |
at getRawBody (/home/francisco/dev/projects/monitor/node_modules/raw-body/index.js:106:12) | |
at read (/home/francisco/dev/projects/monitor/node_modules/body-parser/lib/read.js:76:3) | |
at jsonParser (/home/francisco/dev/projects/monitor/node_modules/body-parser/lib/types/json.js:127:5) | |
at Layer.handle [as handle_request] (/home/francisco/dev/projects/monitor/node_modules/express/lib/router/layer.js:95:5) | |
at trim_prefix (/home/francisco/dev/projects/monitor/node_modules/express/lib/router/index.js:317:13) | |
at /home/francisco/dev/projects/monitor/node_modules/express/lib/router/index.js:284:7 | |
at Function.process_params (/home/francisco/dev/projects/monitor/node_modules/express/lib/router/index.js:335:12) | |
at next (/home/francisco/dev/projects/monitor/node_modules/express/lib/router/index.js:275:10) |
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
public class Resultado { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
String op = "*"; | |
int A=7, B=3, R=12; | |
switch (op) { | |
case "-": |
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
############### Primeira Parte ############### | |
sudo apt-get update && | |
sudo apt-get upgrade && | |
sudo apt-get install build-essential && | |
sudo apt-get install python-dev && | |
sudo apt-get install python3-dev && | |
sudo apt-get install python3-setuptools && | |
sudo apt-get install python-pip && | |
sudo apt-get install python3-pip && | |
sudo pip install virtualenv && |
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
/* | |
echo | |
reenvia para o computador o dado recebido pela serial | |
*/ | |
byte byteRead; | |
void setup() { | |
//configura a comunicação seria com baud rate de 9600 | |
Serial.begin(9600); |
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
#contact.html | |
<!-- Contact form --> | |
<form method="POST" action="{% url 'contact:contact_us' %}" class="pi-contact-form"> | |
{% csrf_token %} | |
<div class="pi-error-container"></div> | |
<div class="pi-row pi-grid-small-margins"> | |
<div class="pi-col-sm-6"> | |
<div class="form-group pi-padding-bottom-10"> | |
<label for="id_name">Nome *</label> | |
{{ contact_form.name|attr:"placeholder:Seu nome aqui"|attr:"required"|add_class:"form-control form-control-name" }} |