Skip to content

Instantly share code, notes, and snippets.

View yassinehamouten's full-sized avatar
💭
I may be slow to respond.

Yassine Hamouten yassinehamouten

💭
I may be slow to respond.
View GitHub Profile
@yassinehamouten
yassinehamouten / php-style-guide.md
Created February 27, 2024 15:01 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@yassinehamouten
yassinehamouten / varnishlog-examples.sh
Created February 27, 2024 09:56 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@yassinehamouten
yassinehamouten / Interview back-end developer
Created October 17, 2021 16:18 — forked from jpchateau/Interview back-end developer
Entretien développeur back : PHP / Symfony / MySQL
Cible : Développeur PHP / Symfony / MySQL
Niveau : Senior
Ce document propose des questions classiques, sans piège, à poser lorsque vous désirez valider un candidat pour un poste de développeur back.
J'utilise personnellement cette trame de questions, libre à vous de vous en inspirer, d'ajouter vos propres questions, et de déterminer lesquelles sont éliminatoires à vos yeux.
Veille technologique
Quelle est la version actuelle de PHP ?
> http://php.net/supported-versions.php
@yassinehamouten
yassinehamouten / GIT.MD
Created October 17, 2021 16:14 — forked from jpchateau/GIT.MD
Git - Commandes / Configuration / Astuces

Commandes

git add -vA # ajoute tous les changements au commit, verbeux
git rm [fichiers] # supprime les fichiers du dépôt
git add -p [fichier] # permet de préciser quels morceaux de code d'un fichier sont à ajouter au commit
git pull # met à jour ses fichiers locaux à partir d'un dépôt distant (cela effectue un fetch puis un merge)
git pull -r # met à jour ses fichiers locaux en effectuant un rebase
git push # envoie les modifications locales sur un dépôt distant
git push -f # force à envoyer ses modifications locales sur un dépôt distant. À utiliser avec précaution.