function formatCnpjCpf($value)
{
$cnpj_cpf = preg_replace("/\D/", '', $value);
if (strlen($cnpj_cpf) === 11) {
return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
}
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
// starts a hot reload server from a folder | |
browser-sync start --server 'public' --files '**/*.*' |
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
{ | |
// Define o tema do VSCode | |
"workbench.colorTheme": "Shades of Purple", | |
// Configura tamanho e família da fonte | |
"editor.fontSize": 18, | |
"editor.lineHeight": 24, | |
"editor.fontFamily": "Fira Code", | |
"editor.fontLigatures": true, | |
"explorer.compactFolders": false, |
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
class MikrotikModel { | |
// atributos do model | |
protected $attributes = []; | |
// instância da API | |
protected $api; | |
// comando base | |
protected $baseComm = "/"; |
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
:global addNetmapRules do={ | |
:for i from=0 to ($count - 1) do={ | |
:local pRange "$($portStart + ($i * $portsPerAddr))-$($portStart + (($i + 1) * $portsPerAddr) - 1)" | |
/ip firewall nat add chain=src-nat action=netmap protocol=tcp \ | |
src-address=($srcStart + ($i * 256)) to-address=$toAddr to-ports=$pRange | |
/ip firewall nat add chain=src-nat action=netmap protocol=udp \ | |
src-address=($srcStart + ($i * 256)) to-address=$toAddr to-ports=$pRange | |
} | |
} |
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
#! /usr/bin/python | |
print "\n*********************************************************************" | |
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version" | |
import os | |
import socket | |
import hashlib | |
import struct | |
# get the host id and host name to calculate the hostkey | |
hostid=os.popen("hostid").read().strip() | |
hostname = socket.gethostname() |
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
'pusher' => [ | |
'driver' => 'pusher', | |
'key' => env('PUSHER_APP_KEY'), | |
'secret' => env('PUSHER_APP_SECRET'), | |
'app_id' => env('PUSHER_APP_ID'), | |
'options' => [ | |
'cluster' => env('PUSHER_APP_CLUSTER'), | |
'encrypted' => env('WS_ENCRYPTED', true), | |
'host' => env('WS_HOST', '127.0.0.1'), | |
'port' => env('WS_PORT', 6001), |
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 | |
namespace Tests\Feature; | |
use App\Client; | |
use App\Employer; | |
use App\Occupation; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; |
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
#!/usr/bin/env bash | |
#--------------------------------------------------------------- | |
# Continuous Integration (CI) - Deployment Shell Script | |
# Build for deploy Laravel applications after CI check | |
# Author: Jorge -JJSQUADY- Junior | |
# July, 2017 | |
# | |
# Transfer this file to server | |
# and run it: bash <name_of_this_script> | |
#--------------------------------------------------------------- |