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 date="25/09/2019"; | |
date.split("/"); | |
var newDate = date[1]+"/"+date[0]+"/"+date[2]; | |
console.log(new Date(newDate).getTime()) |
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
@echo off | |
setlocal EnableDelayedExpansion | |
title Bat otimizacao do Windows 10 | |
ver | find "10." > nul | |
if errorlevel 1 ( | |
echo Sua versão do Windows nao e o Windows 10.! | |
TIMEOUT 5 | |
exit | |
) |
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
#!/bin/bash | |
#lista a quantidade de registros | |
#substituir <service-name> | |
QUANTIDADE="`ls | ps -e -o comm | grep <service-name> | wc -l`" | |
#se $QUANTIDADE for menor que 1: | |
if [ $QUANTIDADE -lt 1 ]; | |
then | |
#ativa o serviço | |
service <service-name> start |
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 | |
//PRODUÇÃO | |
if (isset($_SERVER['HTTPS']) && | |
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || | |
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && | |
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') | |
{ | |
define('BASE_URL', 'https://dominio.com.br/'); | |
} |
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 | |
function validaCNPJ($cnpj) | |
{ | |
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj); | |
// Valida tamanho | |
if (strlen($cnpj) != 14) | |
return false; | |
// Verifica se todos os digitos são iguais |
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 maven:3.5-jdk-8 |
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' | |
services: | |
mysql: | |
container_name: mysql_server | |
image: mysql/mysql-server:5.7 | |
environment: | |
MYSQL_DATABASE: admin | |
MYSQL_ROOT_PASSWORD: secret | |
MYSQL_ROOT_HOST: '%' | |
ports: |
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' | |
services: | |
#PHP Service | |
php: | |
image: binhle410/php7.2-fpm | |
container_name: php-fpm | |
depends_on: | |
- db | |
command: bash -c "php-fpm && php-fpm -v" |
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' | |
services: | |
#Apache + PHP Service | |
apache-php: | |
image: saitam10/apache2-php7.2 | |
container_name: apache2-php7.2 | |
restart: always | |
ports: | |
- "80:80" |
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 maven:3.5-jdk-8 as BUILD | |
COPY src /usr/src/myapp/src | |
COPY pom.xml /usr/src/myapp | |
RUN mvn -f /usr/src/myapp/pom.xml clean package | |
FROM tomcat:9.0 | |
COPY --from=BUILD /usr/src/myapp/target/projeto-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/projeto.war |