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 / 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 / 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 / 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 / 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 / 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 / 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 / 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]