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
<?php | |
$hora = 123456; | |
$h = substr($hora, -6, 2); // retorna "f" | |
$m = substr($hora, -4, 2); // retorna "ef" | |
$s = substr($hora, -2); // retorna "d" | |
$hora2 =$h.$m.$s; | |
echo $hora2; | |
echo "<br>", $h, ("h "), $m,("m "), $s, ("s"); |
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
<?php | |
//Conversão de hora milessegundos para hora, minuto e segundos. | |
$contasegundos = floor($row['HORA']/1000); | |
$horas = floor($contasegundos / 3600); | |
$minutos = floor(($contasegundos - ($horas * 3600)) / 60); | |
$segundos = floor($contasegundos % 60); | |
$row['HORA'] = $horas."h ".$minutos."min ".$segundos."s"; | |
//fim | |
?> |
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
- Docker images para homologação | |
httpd 2.4.34 | |
tomcat 9.0.12 | |
- Puxando as imagens | |
docker run httpd:2.4.34 | |
docker run tomcat:9.0.12 | |
- Compactar pata .tar | |
docker save httpd:2.4.34 > http.tar |
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"; |
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
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
# 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
<!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
#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
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) | |
) |
OlderNewer