Skip to content

Instantly share code, notes, and snippets.

View alexbonhomme's full-sized avatar

Alexandre Bonhomme alexbonhomme

View GitHub Profile
@alexbonhomme
alexbonhomme / make-release.sh
Last active January 29, 2019 08:31
Release script
#! /bin/bash
if [[ "$#" -lt 1 ]]; then
printf "\033[0;31mUsage: $0 version \e[0m\n"
exit -1
fi
RELEASE_VERSION=$1
BRANCH_NAME="release-$RELEASE_VERSION"
@alexbonhomme
alexbonhomme / installation.sh
Last active January 8, 2018 11:17
RPI 3 Timemachine
# Hostname
echo "mnemosyne" | sudo tee /etc/hostname > /dev/null
sudo sed -i 's/raspberrypi/mnemosyne/g' /etc/hosts
# Fix locales
echo "LANG=\"en_GB.UTF-8\"
LC_MESSAGES=\"en_GB.UTF-8\"
LANGUAGE=\"en_GB.UTF-8\"
LC_CTYPE=\"en_GB.UTF-8\"
LC_ALL=\"en_GB.UTF-8\"" | sudo tee /etc/default/locale > /dev/null
--- configure 2017-09-12 15:15:16.000000000 +0200
+++ configure12 2017-09-12 15:14:41.000000000 +0200
@@ -5005,7 +5005,7 @@
;;
- 9.0)
+ 12.1)
@alexbonhomme
alexbonhomme / macosx-install-php-oracle-oci8-pdo_oci.md
Last active March 27, 2024 08:49 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew
@alexbonhomme
alexbonhomme / update_username.sh
Created July 20, 2017 10:26
Update Github username in local repos
# Update and convert old HTTPS sources
find . -path "*/.git/config" -exec sed -i '' -e "s,url = https://github.com/blckshrk,url = git@github.com:alexbonhomme,g" {} \;
# Update SSH sources
find . -path "*/.git/config" -exec sed -i '' -e "s,url = git@github.com:blckshrk,url = git@github.com:alexbonhomme,g" {} \;
# checks
find . -path "*/.git/config" -print0 | xargs -0 grep 'alexbonhomme'
@alexbonhomme
alexbonhomme / post-receive
Created July 14, 2016 14:17
Push to deploy GIT hook
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]] || [[ $ref =~ .*/develop$ ]];
then
export branch=${ref:11}
echo "$branch received. Deploying $branch branch..."
git --work-tree=/home/user/www --git-dir=/home/user/repo checkout -f $branch

Workflow de mise en production pour Symfony 3

Clone du dépot

git clone ...

Vérfier les deps Symfony

php bin/symfony_requirements

Installation deps

@alexbonhomme
alexbonhomme / CreateClientCommand.php
Last active May 5, 2016 07:33
Adds command in Symfony2 console to generate OAuth client with given grants.
<?php
/**
* Usage: php app/console acme:oauth-server:client:create --grant-type="password" --grant-type="http://my.custom/grants/access"
*/
namespace AppBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;

Local server

php app/console server:run

php app/console server:stop

Routes list

php app/console debug:router

Send spool emails (SwiftMailer)

php app/console swiftmailer:spool:send --message-limit=10 --env=prod

# compte le nombre de lignes de tous les fichiers JavaScript de l'arborescence.
wc -l `find . -name "*.js"`