Skip to content

Instantly share code, notes, and snippets.

View GlauberF's full-sized avatar
🎯
Foco e determinação nos objetivos.

Glauber Funez GlauberF

🎯
Foco e determinação nos objetivos.
View GitHub Profile
@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).
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
#
# 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
@GlauberF
GlauberF / .htaccess
Created June 13, 2022 11:46 — forked from cyberwani/.htaccess
Block the HTTRACK using HTACCESS files
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 13:13 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@GlauberF
GlauberF / optimize-css.gulpfile.js
Created January 26, 2022 12:39 — forked from subodhkumarWM/optimize-css.gulpfile.js
CSS optimization post Angular prod build
const gulp = require("gulp");
const filter = require("gulp-filter");
const purify = require("gulp-purify-css");
const gzip = require("gulp-gzip");
const brotli = require("gulp-brotli");
const clean = require("gulp-clean");
const { series, parallel } = require("gulp");
// #1 | Optimize CSS
/*
@GlauberF
GlauberF / parseFunction.js
Created May 4, 2021 17:39 — forked from lamberta/parseFunction.js
Parse a JavaScript string function definition and return a function object. Does not use eval.
/* Parse a string function definition and return a function object. Does not use eval.
* @param {string} str
* @return {function}
*
* Example:
* var f = function (x, y) { return x * y; };
* var g = parseFunction(f.toString());
* g(33, 3); //=> 99
*/
function parseFunction (str) {
@GlauberF
GlauberF / instalar_programanas_deepin.sh
Created February 16, 2021 11:44 — forked from tgmarinho/instalar_programanas_deepin.sh
Instalação de Programas no Linux Deepin
#!/bin/bash
## RECOMENDO EXECUTAR ESSE SCRIPT NA PASTA DOCUMENTOS DENTRO DO USUARIO
echo "PRECISA DE INTERNET PARA EXECUTAR ESSE SCRIPT"
echo "FAZ DOWNLOAD DE ARQUIVOS NA NET"
sudo su
apt-get update -y
@GlauberF
GlauberF / date-fns-date-adapter.ts
Created February 2, 2021 18:54 — forked from JoniJnm/date-fns-date-adapter.ts
date-fns angular material adapter
import {Injectable} from '@angular/core';
import {DateAdapter} from '@angular/material';
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns';
// CONFIG. Use environment or something for a dynamic locale and settings
import {es as locale} from 'date-fns/locale';
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday...
export const MAT_DATE_FNS_DATE_FORMATS = {
import { ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Input, Type, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
@Directive({
selector: '[lazyComp]'
})
export class LazyCompDirective {
private _inputs;
private _outputs;
private subscription = new Subscription();
@GlauberF
GlauberF / KeyEventSimulator.js
Created April 29, 2020 10:28
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};