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
const seconds = 30; | |
const lsKey = "acesso-anterior"; | |
if (localStorage.getItem(lsKey) === null) | |
setTimeout(showElements, seconds * 1000); | |
else | |
showElements(); | |
function showElements() { |
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
<?php | |
//código que eu não vi no print... | |
$historicoDeOperacoes = []; | |
switch($operacao){ | |
case "saque": | |
$_SESSION["saldo"] -= $valor; |
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
var startDate = new Date(2021, 3, 1); | |
var endDate = new Date(2021, 4, 1); | |
var diffTime = Math.abs(endDate - startDate); | |
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); | |
var totalWeeks = Math.round(diffDays / 7); | |
var remainingDays = diffDays % 7; | |
//se quiser considerar o dia final também, descomente a linha abaixo: |
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 php:7.4-apache | |
RUN apt-get update | |
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev | |
RUN a2enmod rewrite | |
RUN docker-php-ext-install mysqli | |
RUN docker-php-ext-enable mysqli |
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
version: '3.4' | |
services: | |
es01: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0 | |
container_name: es01 | |
environment: | |
- node.name=es01 | |
- cluster.name=es-docker-cluster | |
- discovery.seed_hosts=es02,es03 |
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
version: "3.1" | |
services: | |
www: | |
build: . | |
ports: | |
- "8001:80" | |
volumes: | |
- ./:/var/www/html/ | |
networks: |
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 php:5.6-apache | |
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \ | |
-e 's|security.debian.org|archive.debian.org/|g' \ | |
-e '/stretch-updates/d' /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev | |
RUN a2enmod rewrite |
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
<?php | |
$isAuthorized = isUserAuthorized(); //sua lógica para validar se o usuário está ou não autorizado. | |
if(!$isAuthorized) | |
die(header("Location: index.php")); //se o usuário não tiver autorização, redireciona ele pra index e encerra o script com die() | |
// aqui ele tá autorizado, então bora servir a imagem... | |
$image = $_GET["image"]; //supondo que a URL foi acessada via: showImage.php?image=foto123.png |
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
<?php | |
class A { | |
private $x; | |
public function __construct(){ | |
$this->x = "testando"; | |
} | |
public function __toString(){ |
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
<?php | |
$soma = 0; | |
$fornecedor = ""; | |
while($mostrar = mysql_fetch_row($result)){ | |
if($fornecedor == "") | |
$fornecedor = $mostrar[3]; | |
if($fornecedor != $mostrar[3]){ |