Skip to content

Instantly share code, notes, and snippets.

View fhferreira's full-sized avatar
🏠
Home-Office since 2005

Flávio H. Ferreira fhferreira

🏠
Home-Office since 2005
View GitHub Profile
-> GRID - onRecord
--------------------------------------------------------------------
{wpp} = "<img class='cm_wpp' data-phone='".{telefone}."' data-nome='".{nome}."' data-id='".{id}."' src='/scriptcase9/app/BootstrapTour/_lib/img/grp__NM__ico__NM__if_WhatsApp_1298775.png' border='0'>";
--------------------------------------------------------------------
-> GRID - onScriptInit
  • Qual é o problema com a arquitetura das aplicações atuais?
  • Um projeto, na maioria das vezes, é começado pequeno, por uma pessoa e sem saber como será a sua evolução.
  • Pode acontecer de novas pessoas entrarem no projeto e não conhecerem as regras que guiam a aplicação.
  • Um dos princípios de organização é o MVC ou Model View Controller.
  • No MVC a regra de negócio fica na Model, os templates na View e a mediação é feita pelo Controller.
  • O MVC não é suficiente para manter uma aplicação com código compreensível durante muito tempo.
  • A ideia de utilizar MVC veio de frameworks e a maioria das aplicações estão acopladas de alguma maneira a frameworks.
  • Um projeto é iniciado normalmente (1) escolhendo um framework, (2) instalando um esqueleto, (3) removendo códigos de demonstração, (
@jeffturcotte
jeffturcotte / Install.sh
Created March 19, 2018 19:20
Laravel Mix / Echo Server / Docker / Traefik Examples
# clone repo
git clone https://github.com/imarc/laravel-echo-example
cd laravel-echo-example
# install php dependencies
composer install
composer run-script install-tasks
# install npm dependencies and build
npm install
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active December 3, 2023 13:20
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@nasrulhazim
nasrulhazim / bitbucket-pipelines.yml
Last active May 11, 2021 14:25
Laravel BitBucket Pipeline
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.2.1-fpm
pipelines:
default:
- step:
@mpociot
mpociot / link-between-messengers.php
Last active May 20, 2019 23:16
Use BotMan to link between multiple messenger services
@mezzomondo
mezzomondo / aurora_vertical_scaling.md
Last active October 10, 2023 12:32
Automatic vertical scaling of an Aurora cluster

The problem (AKA don't waste money)

One of my clients is a big company that has a very variable but predictable database usage pattern. In the weekdays morning they come up with a huge amount of INSERTs and UPDATEs while for the rest of the day, form noon on, the usage is fairly limited to a decent amount of SELECTs with very low writing activity. The smallest class type that can handle the morning's volume is db.r3.large but having such an instance running all day long and in the weekends is just a big waste of resources money (or a big favour we do to Amazon, from their point of view).

The solution

So I was wondering if there's some autoscaling mechanism for Aurora writers (there is, but only for replicas),

@holmberd
holmberd / php-pools.md
Last active June 4, 2024 20:02
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@gangsta
gangsta / SSL.md
Last active February 23, 2024 03:56
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@KerryRitter
KerryRitter / after.sh
Created October 4, 2017 01:46
Laravel+Homestead VSCode
#!/bin/sh
# Use as "after.sh" on the homestead repo and redo `vagrant reload --provision`.
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
wget https://xdebug.org/files/xdebug-2.5.5.tgz
tar xvzf xdebug-2.5.5.tgz