Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Bonhomme alexbonhomme

View GitHub Profile
View macosx-install-php-oracle-oci8-pdo_oci.md
View make-release.sh
#! /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"
View installation.sh
# 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
View configure.patch
--- 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 / update_username.sh
Created Jul 20, 2017
Update Github username in local repos
View update_username.sh
# 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'
View symfony3_prod.md

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

View git_tips.md

Déplacer les N derniers commits vers une NOUVELLE branche (ne fonctionne pas avec une branche déjà créée)

git branch newbranch
git reset --hard HEAD~N
git checkout newbranch

Renommer un tag local/distant

@alexbonhomme
alexbonhomme / post-receive
Created Jul 14, 2016
Push to deploy GIT hook
View post-receive
#!/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
View symfony2_tips.md

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

@alexbonhomme
alexbonhomme / CreateClientCommand.php
Last active May 5, 2016
Adds command in Symfony2 console to generate OAuth client with given grants.
View CreateClientCommand.php
<?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;
You can’t perform that action at this time.