Skip to content

Instantly share code, notes, and snippets.

View akiletour's full-sized avatar
💛
Available

Pascal GAULT akiletour

💛
Available
View GitHub Profile
@akiletour
akiletour / .bashrc_mac
Last active January 2, 2016 05:09
bash aliases for mac
alias l='ls -Alh'
alias vhost='sudo subl /etc/hosts'
alias mountweb='mkdir /Volumes/www && mount -t smbfs //aki:XXPASSWORDXX@akibuntu/www /Volumes/www'
alias getcomposer='curl -s https://getcomposer.org/installer | php'
alias sshl='cat ~/.ssh/config'
#symfony2
alias dsv='app/console doctrine:schema:update --dump-sql'
alias dsu='app/console doctrine:schema:update --force'
alias dfl='app/console doctrine:fixtures:load'
@akiletour
akiletour / mysqlexport
Created January 22, 2014 13:17
Gives the possibility to dump a SQL table
#!/bin/bash
DATE=`date +%Y%m%d`
DB=$1
mysqldump --verbose -uXXXX -pXXXX $DB > $DB"_"$DATE.sql
@akiletour
akiletour / Product.php
Last active August 29, 2015 13:55
Symfony2: Update the slug of a product with ID-TITLE (postPersist)
<?php
// src/Aki/MyBundle/Entity/Product.php
/**
* [...]
* @ORM\HasLifecycleCallbacks()
*/
class Product
{
[...]
<?php
// src/Acme/DemoBundle/DataFixtures/AbstractDataFixture.php
namespace Acme\DemoBundle\DataFixtures;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Console\Output\ConsoleOutput;
@akiletour
akiletour / git-new-origin
Created April 12, 2016 14:49
Moving git repository to a new server
#!/bin/bash
git clone --mirror <url_of_old_repo>
cd <name_of_old_repo>
git fetch
git remote add new-origin <url_of_new_repo>
git push new-origin --mirror
git remote rm origin
git remote rename new-origin origin
#!/bin/bash
CONTAINER=$1
if [ -z "$1" ]
then
echo "ERROR: Container name missing"
exit
fi
#!/bin/bash
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
@akiletour
akiletour / Brewfile
Last active July 21, 2017 07:42
Brewfile for Development Workstation
tap 'caskroom/cask'
brew 'git'
brew 'npm'
cask 'sequel-pro'
cask 'tower'
cask 'focus'
cask 'iterm2'
cask 'adobe-creative-cloud'
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@akiletour
akiletour / create-admin.php
Created October 10, 2018 10:26
Allows us to generate administrator on Prestashop 1.6
<?php
// PRESTASHOP 1.6 - Generate administrator
// php create-admin.php EMAIL PASSWORD
// This file must be placed in the root directory of the project
// Delete it after
$firstname = 'Support';
$lastname = 'Dutiko';
$email = trim($argv[1]);
$pwdClear = trim($argv[2]);