Skip to content

Instantly share code, notes, and snippets.

View tuongaz's full-sized avatar
🏠
Working from home

Tuong Le tuongaz

🏠
Working from home
View GitHub Profile
@tuongaz
tuongaz / BaseModelManager.php
Created April 1, 2012 03:51
Symfony2 Model Manager
<?php
abstract class BaseModelManager {
protected $em;
protected $class;
protected $repository;
protected $container;
/**
* Constructor.
@tuongaz
tuongaz / test_bootstrap.php
Created April 10, 2012 11:46
Bootstrap for PHPUnit in Symfony2
<?php
// in /app/my_phpunit_bootstrap.php:
require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Input\ArrayInput;
@tuongaz
tuongaz / xdebug.ini
Created May 3, 2012 01:07
XDebug Config
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = [LOCATION_TO_OUTPUT_DIR]
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_connect_back = 1
xdebug.remote_host = [IP_ADDRESS_OF_MACHINE_WHERE_YOUR_IDE_IS]
xdebug.remote_log = [LOCATION_TO_LOG_FILE]
@tuongaz
tuongaz / git_untrack_file_folder
Created January 9, 2013 20:12
Untrack file or folder
git rm -r --cached <your directory>
git commit -m 'Untrack files....'
#!/usr/bin/env php
<?php
//
// PHP REPL with initialized Magento environment
//
// Thanks to https://github.com/d11wtq/boris
//
// Drop this script in your $PATH and run it anywhere in a Magento directory tree to start the REPL
//
@tuongaz
tuongaz / test.php
Created September 19, 2013 01:47
Sample of queue test
<?php
/**
* Error reporting
*/
error_reporting(E_ALL | E_STRICT);
/**
* Compilation includes configuration file
*/
define('MAGENTO_ROOT', '../share/magento');
@tuongaz
tuongaz / sv
Last active August 29, 2015 13:57
Quick function to run Vagrant servers
function sv() {
SERVERS_DIR=/Users/tuongaz/servers
if [[ $# == 0 ]]; then
printf "sv server command\n"
printf "List servers:\n"
for dir in $(ls $SERVERS_DIR)
do
if [[ -d "$SERVERS_DIR/$dir" ]]; then
printf "* $dir\n"
@tuongaz
tuongaz / keybase.md
Created July 15, 2014 05:35
keybase.md

Keybase proof

I hereby claim:

  • I am tuongaz on github.
  • I am tuongaz (https://keybase.io/tuongaz) on keybase.
  • I have a public key whose fingerprint is 96D2 A015 FF74 89DC DF39 FABB 8807 3D2A 72DB 199D

To claim this, I am signing this object:

@tuongaz
tuongaz / port_forward.sh
Created August 21, 2014 02:21
Vagrant port 80 forward from Host to Guest
sudo ssh -p 2222 -gNfL 80:localhost:80 vagrant@localhost -i ~/.vagrant.d/insecure_private_key
@tuongaz
tuongaz / layer.js
Last active March 10, 2016 04:46
Layer Chat
import {Injectable, Inject} from 'angular2/core';
import {Http, HTTP_PROVIDERS, Headers} from 'angular2/http';
import 'rxjs/add/operator/map';
import {Observable, Subject} from 'rxjs';
import * as layer from 'layer-websdk';
import * as _ from 'lodash';
export class Layer {
layerClient: layer.Client;
http: Http;