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 quillOp.js
function quill(html) {
let parser = new DOMParser();
let dom = parser.parseFromString(html, "text/html");
let quillOps = [];
let elementToQuill = (el, attributes) => {
if (el.nodeType === Node.TEXT_NODE) {
el.textContent.split(" ").forEach((word) => {
if (word) { // para evitar a inserção de strings vazias
@GlauberF
GlauberF / template.json
Last active February 9, 2023 19:18
teste
View template.json
{
"isTestData":false,
"outputFormat":"pdf",
"report":{
"styles":[
],
"version":3,
"parameters":[
@GlauberF
GlauberF / timezone.config
Created December 8, 2022 23:45 — forked from StefanieD/timezone.config
AWS Elastic Beanstalk configuration file for set up your app timezone (independent from EC2 region).
View timezone.config
container_commands:
01changePHP:
command: sed -i '/PHP_DATE_TIMEZONE/ s/UTC/Europe\/Berlin/' /etc/php.d/environment.ini
01achangePHP:
command: sed -i '/aws.php_date_timezone/ s/UTC/Europe\/Berlin/' /etc/php.d/environment.ini
02change_AWS_PHP:
command: sed -i '/PHP_DATE_TIMEZONE/ s/UTC/Europe\/Berlin/' /etc/httpd/conf.d/aws_env.conf
03php_ini_set:
command: sed -i '/date.timezone/ s/UTC/Europe\/Berlin/' /etc/php.ini
commands:
@GlauberF
GlauberF / nginx.conf
Created October 21, 2022 20:30 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
View nginx.conf
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
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]
@GlauberF
GlauberF / CountryCodes.php
Last active August 10, 2022 02:46
Country Codes
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 July 22, 2022 17:08
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
@GlauberF
GlauberF / nGram.js
Last active July 14, 2022 17:53
NGram
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 June 13, 2022 11:46 — 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|