Skip to content

Instantly share code, notes, and snippets.

View csanquer's full-sized avatar

Charles Sanquer csanquer

View GitHub Profile
@jwage
jwage / SplClassLoader.php
Last active July 23, 2024 18:42
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@pylebecq
pylebecq / pre-commit
Last active December 22, 2015 09:09
Git pre-commit hook that checks the syntax of commited php files and runs the php-cs-fixer on them.
#!/usr/bin/env php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependency: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*/
@christianclinton
christianclinton / gist:faa1aef119a0919aeb2e
Last active January 5, 2024 04:08
RabbitMQ Password Hash - Python
#!/bin/env/python
import hashlib
import binascii
# Utility methods for generating and comparing RabbitMQ user password hashes.
#
# Rabbit Password Hash Algorithm:
#
# Generate a random 32 bit salt:
# CA D5 08 9B
@badsyntax
badsyntax / haproxy.1.cfg
Last active September 19, 2022 09:38
Some example haproxy configs
# SSL termination at proxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
@brunobord
brunobord / pre-commit.sh
Created June 29, 2016 07:27
Pre commit hook ; flake8 on all python files only
#!/usr/bin/env bash
FILES=`git diff --cached --name-only | grep .py$`
if [ $FILES ]
then
flake8 --config=./flake8.conf $FILES
if [ $? != 0 ]
then
user=`whoami`
echo "-- Hey, $user, correct file formating before committing plz"