function formatCnpjCpf($value)
{
$CPF_LENGTH = 11;
$cnpj_cpf = preg_replace("/\D/", '', $value);
if (strlen($cnpj_cpf) === $CPF_LENGTH) {
return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
}
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
# Map the Header Accept to the webp format | |
map $http_accept $webp_suffix { | |
"~*webp" ".webp"; | |
} | |
# Path to the directory to store the fastcgi cache files | |
fastcgi_cache_path /tmp/cache/example levels=1:2 keys_zone=pmquest:23m max_size=1g inactive=60m; | |
# redirect http to https | |
server { | |
listen 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
# Pull docker certbot image | |
docker pull certbot/certbot | |
# Create a dir for mount in containers, and save letsencrypt folders | |
mkdir letsencrypt # or any name you want | |
# Run a container and follow the instructions | |
docker run -it --rm -v "$PWD"/letsencrypt:/etc/letsencrypt certbot/certbot certonly --manual -d yourdomain.com |
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
Please use with caution, if you do not understand what these extensions are for, then document yourself first. | |
PHP LIBEVENT | |
WARNING: CAUSES SEGEMENTATION FAULT ON PHP 7.0 ! | |
------------------------------------------ | |
cd /usr/src/ | |
git clone https://github.com/expressif/pecl-event-libevent.git | |
cd pecl-event-libevent | |
phpize | |
./configure |
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: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
ports: | |
- "3406:3306" | |
restart: always |
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 | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
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 | |
/*ini settings*/ | |
set_time_limit(0); | |
ini_set('memory_limit', '512M'); | |
//DOWNLOAD SCRIPT | |
$filePath = "G:/Software/versions/..PATH TO DOWNLOAD FILE...zip"; // set your download file path here. | |
download($filePath); // calls download function | |
function download($filePath) | |
{ |
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 | |
// API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = array( $_GET['id'] ); | |
// prep the bundle | |
$msg = array |
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
git archive --format zip --output /full/path/to/zipfile.zip master |
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
Alimentos e Bebidas | |
Arte e Antiguidades | |
Artigos Religiosos | |
Assinaturas e Revistas | |
Automóveis e Veículos | |
Bebês e Cia | |
Blu-Ray | |
Brindes / Materiais Promocionais | |
Brinquedos e Games | |
Casa e Decoração |
NewerOlder