Skip to content

Instantly share code, notes, and snippets.

View tiagofrancafernandes's full-sized avatar
😊
Loved by Jesus Christ. PHP/Laravel developer; Linux user; Open-source maker;

Tiago França tiagofrancafernandes

😊
Loved by Jesus Christ. PHP/Laravel developer; Linux user; Open-source maker;
View GitHub Profile
@tiagofrancafernandes
tiagofrancafernandes / gitignore_per_git_branch.md
Last active January 2, 2020 15:35 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@tiagofrancafernandes
tiagofrancafernandes / conteudos_sobre_gist.md
Last active March 20, 2021 21:08
Conteúdos sobre GIST visto durante a gravação do vídeo
@tiagofrancafernandes
tiagofrancafernandes / README.md
Last active September 2, 2021 19:04
Count ratings in PHP

Count ratings in PHP

How to use

$ratings    = [10,5,7,2];
$max_rating = 10;

//Rating with representation
$rating         = getRatings($ratings, $max_rating, true);
@tiagofrancafernandes
tiagofrancafernandes / em-manutencao.html
Created December 23, 2021 15:08
Simple Pages | Páginas simples | HTML Basic
<!doctype html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="MY APP">
<base href="https://getbootstrap.com/docs/5.1/examples/sticky-footer/">
<meta name="generator" content="MY APP">
# Exportar
TABLE_NAME="TABELA_ORIGEM"; PGPASSWORD="usuario2016" pg_dump \
-h HOST_ORIGIEM \
-p 5432 \
-U usuario \
--table="$TABLE_NAME" \
usuario > "db-banco-origem-$TABLE_NAME.sql" && notify-send "Finalizado!"
#Importar
DB_NAME="BANCO_DESTINO"; TABLE_NAME="partner_sales"; PGPASSWORD="senha" psql \
@tiagofrancafernandes
tiagofrancafernandes / omni-requests.http
Last active February 21, 2022 01:50
one-signal snippets
### Send based on External User IDs - Create notification
# https://documentation.onesignal.com/reference/create-notification#send-based-on-external-user-ids---create-notification
curl -X POST https://onesignal.com/api/v1/notifications \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Authorization: Basic MjViNDc3NWEtNjg0MS00NzI1LThlMTQtZGY3YTg4MWZlZGNk' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"app_id": "fcfd4df3-d387-49e8-a8a1-0a36084b0813",
"include_external_user_ids": ["123456789", "wiz-1234"],