Skip to content

Instantly share code, notes, and snippets.

View zuzuleinen's full-sized avatar

Andrei Boar zuzuleinen

View GitHub Profile
@zuzuleinen
zuzuleinen / git-shortcuts.sh
Last active August 29, 2015 14:05
Git shortcuts
# Initial configuration
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git config --global core.editor "vim"
# If you want to skip the staging area when commiting a file
git commit -a -m 'added new benchmarks'
# Remove a file from git
git rm deleteme.txt
@zuzuleinen
zuzuleinen / virtual-host-ubuntu.sh
Last active August 29, 2015 14:06
Create a virtual host on Ubuntu with Apache2
#Create a symlink between your project and /var/www:
ln -s /home/andreiboar/Projects/HelloMage/ /var/www/hellomage
#Make the site available
sudo vim /etc/apache2/sites-available/hellomage.conf
#This will create a new hellomage file in the /sites-available/ directory. In this file you should add this:
<VirtualHost *:80>
DocumentRoot "/var/www/hellomage"
ServerName hellomage.dev

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@zuzuleinen
zuzuleinen / runTests.sh
Last active August 29, 2015 14:06 — forked from schemar/runTests.sh
#!/bin/bash
function printHelp {
echo "Load fixtures and run tests"
echo "Usage: runTests.sh [options] [directory]"
echo ""
echo "Options:"
echo " -r|--reset resets the sqlite test database before testing"
echo " -h|--help print this help"
echo ""
@zuzuleinen
zuzuleinen / import-db.sh
Created September 19, 2014 09:51
Import database from terminal
#Import my_backup.sql file in my_database for user root on localhost.
#Useful when my_backup.sql can be too large to import it via phpmyadmin
mysql -u root -p -h localhost my_database < my_backup.sql
@zuzuleinen
zuzuleinen / remote-db.php
Last active August 29, 2015 14:06
Remote database connection via phpMyAdmin
<?php
#Edit the config.inc.php file. Usually located in /etc/phpmyadmin/config.inc.php
#Add this with your data:
$i++;
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
@zuzuleinen
zuzuleinen / install-go.sh
Last active August 29, 2015 14:07
Go Installation and Setup
# Download from https://golang.org/dl/
$ sudo tar -C /usr/local -xzf go1.3.3.linux-amd64.tar.gz
#Add the lines bellow to ~/.bashrc file (and .zshrc if you have it)
export GOROOT=/usr/local/go
export GOPATH=/home/andrei/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
#Download LiteIde
https://github.com/visualfc/liteide
@zuzuleinen
zuzuleinen / gist:5cc5d3bf2596f8d45d9c
Created October 20, 2014 09:57
Tmux Config File
# inside ~/.tmux.conf
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
# Highlight active window
set-window-option -g window-status-current-bg red
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*