Skip to content

Instantly share code, notes, and snippets.

View achristodoulou's full-sized avatar

Andreas Christodoulou achristodoulou

View GitHub Profile
@achristodoulou
achristodoulou / git.md
Last active April 14, 2016 06:14
Git useful commands

This command will remove any branches that do not exists anymore:

$ git fetch --all --prune

Get single file from git

$ git archive --remote=ssh://git@git/{repo-name}.git HEAD {filename}

@achristodoulou
achristodoulou / composer.sh
Last active April 11, 2016 08:37
Disable xdebug for composer only
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COMPOSER_DISABLE_XDEBUG_WARN=1 /usr/bin/php \
-d xdebug.remote_enable=0 -d xdebug.profiler_enable=0 \
-d xdebug.default_enable=0 /usr/local/bin/composer.phar "$@"
@achristodoulou
achristodoulou / VirtualBoxCopyPasteFix.sh
Created March 8, 2016 08:51
Fix when copy/paste between virtual box and Host is not working
pkill 'VBoxClient --clipboard' -f & sleep 1 && VBoxClient --clipboard
@achristodoulou
achristodoulou / fluent.php
Created February 22, 2016 13:23
Fluent interface
<?php
interface CaffeineOptionInterface {
/**
* @return MilkOptionInterface
*/
public function decaff();
/**
@achristodoulou
achristodoulou / behat_instructions.md
Last active March 15, 2016 21:25
Setting up behat and connecting with Symfony 2.8 and Mink
  • Install package and dependancies
    • Remember to set minimum-stability eq dev as there is no stable version of the package.
"require-dev": {
        "behat/mink-extension": "^2.1",
        "behat/mink-goutte-driver": "^1.2",
        "behat/mink-selenium2-driver": "^1.3",
        "phpunit/phpunit": "5.2.*",
        "behat/symfony2-extension": "^2.1"
@achristodoulou
achristodoulou / doctrine.startup.sh
Last active February 23, 2016 18:04
When you are writing your first migration many changes are made and this script can drop and recreate the schema
rm -f src/AppBundle/Migrations/*.php &&
php bin/console doctrine:database:drop --force &&
php bin/console doctrine:database:create &&
php bin/console doctrine:migrations:diff &&
php bin/console doctrine:migrations:migrate --no-interaction &&
php bin/console doctrine:fixtures:load --no-interaction
@achristodoulou
achristodoulou / git-rebase.sh
Created December 12, 2015 20:33
Short tutorial with shell script that explains how git rebase works
#Lets initialize an empty repository
git init
#Then create a new file and commit
touch README.md
echo "Hello World" >> README.md
git add .
git commit -m "First commit"
#We need a new branch to work alone
@achristodoulou
achristodoulou / dnf.conflict.resolve.sh
Created December 4, 2015 21:04
When dnf update on fedora fails because of file conflict, just erase the from file
sudo dnf erase <From Library causing conflict>
sudo dnf update
@achristodoulou
achristodoulou / .netrc
Created November 23, 2015 09:29 — forked from dropwhile/.netrc
example netrc
# .netrc
## generate token with https://help.github.com/articles/creating-an-oauth-token-for-command-line-use
machine github.com login <token>