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 / cloudSettings
Last active July 24, 2020 02:18
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-24T02:18:40.755Z","extensionVersion":"v3.4.3"}
@tuongaz
tuongaz / main.go
Created May 3, 2020 02:33
Example of using sync.Cond and broadcast feature
package main
import (
"fmt"
"sync"
"time"
)
// Listen for broadcast.
// The wg waitgroup is to make sure the listen func is called before the broadcast happens.
@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;
@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');
#!/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 / 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....'
@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 / 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 / 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