Skip to content

Instantly share code, notes, and snippets.

View pixmin's full-sized avatar

Gaëtan PRIOUR pixmin

View GitHub Profile
@pixmin
pixmin / exo_form.md
Last active July 25, 2018 10:56
Codi 3 - PHP - Exo Form

Codi3 - PHP

PHP > HTML

1. Créer une page HTML avec un formulaire

Ce formulaire contient un champs dans lequel le visiteur va indiquer son nom.

action

@pixmin
pixmin / nexus5-specs.md
Last active June 24, 2019 14:07
Google / LG Nexus 5 Specs

NEXUS 5

Weight / dimensions

  • Dimensions (mm) 137.84 x 69.17 x 8.59
  • Weight (g) 130.00

Full Specs

GENERAL
@pixmin
pixmin / filter_title.php
Created September 19, 2018 08:27
Wordpress title filter
add_filter('document_title_parts', 'filter_title_part');
function filter_title_part($title) {
$title['title'] = 'Codi ' . $title['title'];
return $title;
}
@pixmin
pixmin / tacces.sh
Last active September 28, 2018 15:03
Tail Apache access logs
#!/bin/bash
tail -n 200 -f /var/log/apache2/www.labelleiloise.fr/access.log \
| grep -vE ".png|.jpg|.gif|.js|.ico|.css|.svg|POST /bms-admin/ajax|.woff2|/php-fpm-status" \
| egrep --color '^|POST|GET|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|HTTP/1.1" [^2][0-9]{1,2}'
# first egreo regex is for IP Address,
# second is for HTTP reponse codes other than 2xx
@pixmin
pixmin / .gitattributes
Created October 22, 2018 09:06
Git Attributes
# Consider compressed/minified JS/CSS files as binary
www/themes/cbi/assets/css/theme.css -diff
www/themes/cbi/assets/js/theme.js -diff
@pixmin
pixmin / git-find-orphans
Created October 25, 2018 12:58
GIT Find orphan commits
$ git log origin/preprod --no-color | grep '^commit' | sed 's#^commit ##' | while read r; do if [ "$(git branch --contains "$r" | wc -l)" == "1" ]; then echo $r; fi; done
@pixmin
pixmin / GitCommands.md
Last active November 14, 2018 10:57
Git useful commands

Git Useful Commands

Git log

Show files changed yesterday

git diff master@{"yesterday"} --stat`

Yesterday's commits (last 24h)

@pixmin
pixmin / Sublime.tmTheme.md
Last active March 14, 2019 15:23
Sublime 3200 Git gutter integration colors
@pixmin
pixmin / check_php_rcf.sh
Created June 24, 2019 13:57
BMS - Check if the PHP RFC page changed
#!/bin/bash
cd /volumes/users/gaetan.priour/Documents/CheckPHPRFC
DATE=`date +"%Y%m%d %H%M"`
# Remove all but the last two
/bin/ls -1tr rfc* | /usr/bin/head -n -2 | /usr/bin/xargs -d '\n' rm -f --
# Get the page