Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Foco e determinação nos objetivos.

Glauber Funez GlauberF

🎯
Foco e determinação nos objetivos.
View GitHub Profile
View .shiftrc
; Within this file you may set preferences for Shift.
; These may be used to customize the behavior of the
; Shift bot by disabling or guiding the automation.
; NOTE: Any paths should be relative to location
; of this file and exclude a trailing slash.
; Section to set options for PHP Shifts.
; [php]
View CountryCodes.php
public function CountryCodes()
{
return [
array('id' => '1','code' => 'US','country' => 'USA','phone_name' => 'USA (+1)','phone_code' => '1'),
array('id' => '2','code' => 'DZ','country' => 'Algeria','phone_name' => 'Algeria (+213)','phone_code' => '213'),
array('id' => '3','code' => 'AD','country' => 'Andorra','phone_name' => 'Andorra (+376)','phone_code' => '376'),
array('id' => '4','code' => 'AO','country' => 'Angola','phone_name' => 'Angola (+244)','phone_code' => '244'),
array('id' => '5','code' => 'AI','country' => 'Anguilla','phone_name' => 'Anguilla (+1264)','phone_code' => '1264'),
array('id' => '6','code' => 'AG','country' => 'Antigua & Barbuda','phone_name' => 'Antigua & Barbuda (+1268)','phone_code' => '1268'),
array('id' => '7','code' => 'AR','country' => 'Argentina','phone_name' => 'Argentina (+54)','phone_code' => '54'),
@GlauberF
GlauberF / print-table.php
Last active Jul 22, 2022
simple piped data generator. #gerador_table_php
View print-table.php
/**
* Table Print
* @example
* echo TablePrinter("|%-15.15s |%-35.35s | x |\n", ['Author', 'Description'], [['Gauber Funez', 'simple piped data generator']]);
*/
function TablePrint(string $mask, array $header, array $data): string {
if (!$mask) {
throw new Exception("Não foi enviado a Máscara | TablePrinter", 1);
}
View signNFe_does_not_throw_an_exception.xml
<NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe Id="NFe42220708094055000110550020000000041422952024" versao="4.00"><ide><cUF>42</cUF><cNF>42295202</cNF><natOp>VENDA DE MERCADORIAS ADQUIRIDAS DE TERCEIROS</natOp><mod>55</mod><serie>2</serie><nNF>4</nNF><dhEmi>2022-07-21T09:23:38-03:00</dhEmi><dhSaiEnt>2022-07-21T18:38:24-03:00</dhSaiEnt><tpNF>1</tpNF><idDest>1</idDest><cMunFG>4204301</cMunFG><tpImp>1</tpImp><tpEmis>1</tpEmis><cDV>4</cDV><tpAmb>2</tpAmb><finNFe>1</finNFe><indFinal>1</indFinal><indPres>1</indPres><indIntermed>0</indIntermed><procEmi>0</procEmi><verProc>1000</verProc></ide><emit><CNPJ>08094055000110</CNPJ><xNome>P &amp; S CENTRO AUTOMOTIVO LTDA</xNome><xFant>PIT STOP AUTO CENTRO</xFant><enderEmit><xLgr>Rua Marechal Deodoro - de 917 a 1685 - lado impar</xLgr><nro>dsfsdf</nro><xBairro>Centro</xBairro><cMun>4204301</cMun><xMun>Concordia</xMun><UF>SC</UF><CEP>89700053</CEP><cPais>1058</cPais><xPais>Brasil</xPais><fone>554998165594</fone></enderEmit><IE>255227515</IE><IM>00022996</IM><CNAE>453
View nGram.js
//////////////////////////////////////
// Example
// nGram(2)('Brasil');
/////////////////////////////////////
/**
* Factory returning a function that converts a value string to n-grams.
*
* @param {number} n
*/
@GlauberF
GlauberF / .htaccess
Created Jun 13, 2022 — forked from cyberwani/.htaccess
Block the HTTRACK using HTACCESS files
View .htaccess
Options All -Indexes
# Ultimate htaccess Blacklist 2 from Perishable Press
# Deny domain access to spammers and other scumbags
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ADSARobot|ah-ha|almaden|aktuelles|Anarchie|amzn_assoc|ASPSeek|ASSORT|ATHENS|Atomz|attach|attache|autoemailspider|BackWeb|Bandit|BatchFTP|bdfetch|big.brother|BlackWidow|bmclient|Boston\ Project|BravoBrian\ SpiderEngine\ MarcoPolo|Bot\ mailto:craftbot@yahoo.com|Buddy|Bullseye|bumblebee|capture|CherryPicker|ChinaClaw|CICC|clipping|Collector|Copier|Crescent|Crescent\ Internet\ ToolPak|Custo|cyberalert|DA$|Deweb|diagem|Digger|Digimarc|DIIbot|DISCo|DISCo\ Pump|DISCoFinder|Download\ Demon|Download\ Wonder|Downloader|Drip|DSurf15a|DTS.Agent|EasyDL|eCatch|ecollector|efp@gmx\.net|Email\ Extractor|EirGrabber|email|EmailCollector|EmailSiphon|EmailWolf|Express\ WebPictures|ExtractorPro|EyeNetIE|FavOrg|fastlwspider|Favorites\ Sweeper|Fetch|FEZhead|FileHound|FlashGet\ WebWasher|FlickBot|fluffy|FrontPage|GalaxyBot|Generic|Getleft|GetRight|
@GlauberF
GlauberF / .php-cs-fixer.php
Created May 4, 2022 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
View .php-cs-fixer.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@GlauberF
GlauberF / deepDiffObj.js
Last active Mar 16, 2022
deepDiffObj, Function to analyze two objects and return if there were changes, if there were not, if something was deleted etc.
View deepDiffObj.js
const deepDiffMapper = function () {
return {
VALUE_CREATED: 'created',
VALUE_UPDATED: 'updated',
VALUE_DELETED: 'deleted',
VALUE_UNCHANGED: 'unchanged',
map: function (obj1, obj2) {
if (this.isFunction(obj1) || this.isFunction(obj2)) {
throw 'Invalid argument. Function given, object expected.';
}
View fparans.json
[
{
"id":1 ,
"name":"page_count",
"type":"number",
"arrayItemType":"string",
"eval":false,
"nullable":false,
"pattern":"",
"expression":"",
@GlauberF
GlauberF / aggregate_mongo.js
Last active Feb 5, 2022
get real object in for_id_supplier
View aggregate_mongo.js
// Requires official MongoShell 3.6+
db = db.getSiblingDB("....");
db.getCollection("produtos").aggregate(
[
{
"$project" : {
"_id" : NumberInt(0),
"produtos" : "$$ROOT"
}
},