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 | |
/** | |
* Calculate percentage increase or decrease | |
* @param int $length | |
*/ | |
function percentage_difference ($old = 0, $new = 0) | |
{ |
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
# Credentials | |
# ======================================== | |
# hostname: localhost | |
# port: 49161 | |
# sid: xe | |
# username: system | |
# password: oracle | |
# On host |
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.3-apache | |
RUN apt-get update -y && apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev libonig-dev libzip-dev git | |
RUN docker-php-ext-install mysqli pdo pdo_mysql | |
RUN docker-php-ext-install mbstring | |
RUN docker-php-ext-install zip | |
RUN docker-php-ext-install gd | |
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg |
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
# 1. Check why Apache isn't starting | |
sudo apachectl configtest | |
# 2. If the message has something like "Code signing absent - not loading module at..." please continue to this walkthrough... | |
# 3. On MacOS, open Keychain Access, go to menu Keychain Access > Certificate Assistant > Create a certificate. | |
# 4. Type a name and select the type "Code signing" then proceed to create it. | |
# 5. After creation, type the following command on the Terminal: | |
sudo codesign --verbose --sign "YOUR_CERTIFICATE_NAME" /usr/local/opt/php/lib/httpd/modules/libphp.so --force |
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
{ | |
"AC": [ | |
"ACRELANDIA", | |
"ASSIS BRASIL", | |
"BRASILEIA", | |
"BUJARI", | |
"CAPIXABA", | |
"CRUZEIRO DO SUL", | |
"EPITACIOLANDIA", | |
"FEIJO", |
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
======================================================================================================= | |
Cole esta política no bucket que contém os dados a serem transferidos | |
Nota: No exemplo abaixo, 000000000000 é a ID da conta da AWS que receberá os dados a serem transferidos | |
======================================================================================================= | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DelegateS3Access", |
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 | |
$tzList = DateTimeZone::listIdentifiers(DateTimeZone::ALL); | |
var_dump($tzList); |
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 | |
# Exibe erros de parsing, exceto notices e warnings | |
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); | |
# Exibe erros de parsing e warnings, exceto notices | |
error_reporting(E_ALL ^ E_NOTICE); |
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
UPDATE `table` SET `column` = REPLACE(`column`, 'origin', 'destiny'); |
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 is_cpf_valid ($cpf) | |
{ | |
$cpf = preg_replace("/[^0-9]/", "", $cpf); | |
$digitoUm = 0; | |
$digitoDois = 0; | |
for($i = 0, $x = 10; $i <= 8; $i++, $x--): | |
$digitoUm += $cpf[$i] * $x; | |
endfor; |