Skip to content

Instantly share code, notes, and snippets.

View joaofds's full-sized avatar
🎯
Focusing

João Ferreira joaofds

🎯
Focusing
  • Goiânia - Brasil
View GitHub Profile
@joaofds
joaofds / awesm.md
Created February 19, 2024 16:23 — forked from matula/awesm.md
Awesome PHP stuff in one Gist
@joaofds
joaofds / git-update-fork.sh
Created February 19, 2024 16:02 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@joaofds
joaofds / gist:9a519317118f5c46650b38bd049a52f6
Created April 1, 2022 13:55 — forked from app-js/gist:c79cf8f99206c5239146a267c60c5dc2
Devilbox Xdebug V.3.x in PHP-Container or WSL for VSCODE
On Linux (or WSL) set 'host.docker.internal: host-gateway' in the PHP service in docker-compose.yml:
dns:
- 172.16.238.100
# MacOS and Windows have this by default, this hack also allows it for Linux
extra_hosts:
docker.for.lin.host.internal: 172.16.238.1
docker.for.lin.localhost: 172.16.238.1
host.docker.internal: host-gateway
@joaofds
joaofds / gist:a8c55373e05e78e8c1c8561e74ad46bc
Created March 7, 2022 01:24
Set up GitHub push with SSH keys
## SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)
### Create a repo.
Make sure there is at least one file in it (even just the README.md)
### Generate a SSH key pair (private/public):
```
ssh-keygen -t rsa -C "[email protected]"
@joaofds
joaofds / ssl-tls-nginx.md
Created February 26, 2022 15:03 — forked from HenriqueSilverio/ssl-tls-nginx.md
Instalação/Configuração de SSL/TLS no Nginx com Let’s Encrypt

SSL/TLS no Nginx com Let’s Encrypt

Instalar o cliente do Let’s Encrypt

Primeiro adicione o repositório do certbot com o seguinte comando:

add-apt-repository ppa:certbot/certbot

Em seguida instale o certbot e o plugin para o Nginx:

@joaofds
joaofds / PHP PDO MySQL Cheat sheet guide.txt
Last active September 1, 2021 16:43
PHP PDO MySQL Cheat sheet guide
PHP PDO MySQL Cheat sheet guide
PDO is a PHP extension for accessing and interacting with databases using object-orientation. As PDO is targetted for executing queries with prepared statements it is (with correct usage) safer than MySQLi.
This PHP PDO cheat sheet goes through methods of creating a connection, SELECT, INSERT, UPDATE and DELETE queries.
Features include: Select if exists, insert update on duplicate, insert short form from an array, return last id and amount of rows affected by the last query.
View on GitHub here.
Creating the database connection
@joaofds
joaofds / git-flow.md
Created June 14, 2021 15:59 — forked from marceloxp/git-flow.md
Git Flow

Utilizando o fluxo Git Flow

Fonte: https://medium.com/trainingcenter/utilizando-o-fluxo-git-flow-e63d5e0d5e04

Este artigo tem o intuito de expor uma abordagem de como trabalhar utilizando o fluxo git flow.

Se você já trabalha com o git como principal ferramenta de controle de versão, já deve ter visto várias abordagens de como utilizar e controlar branchs em um cenário de produção ou pessoal. E se você é novo com git, este fluxo irá te ajudar a ter maior familiaridade de como empresas, projetos opensource costumam utilizar seus fluxos de trabalho. É muito comum vermos pessoas utilizando somente um branch para fazer commits em projetos pessoais. Isto não é errado, é muito tranquilo de se controlar tudo em uma branch quando se está desenvolvendo sozinho, mas o cenário muda bastante quando temos que interagir com mais desenvolvedor ou contribuidores, seja em um projeto opensource ou privado. Nessas horas é suma importância que se tenha total controle do que está sendo produzido por sua equipe, onde, a

@joaofds
joaofds / vscode_shortcuts.md
Created March 7, 2021 02:25 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@joaofds
joaofds / git.md
Created January 14, 2021 14:36 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda