Skip to content

Instantly share code, notes, and snippets.

View tpphu's full-sized avatar

Tran Phong Phu tpphu

View GitHub Profile
@tpphu
tpphu / gist:5667615
Last active December 17, 2015 20:29
private function _getImageNameAndReceive($name, $subPath = null)
{
$ret_name = '';
/*@var $imageElement Zend_Form_Element_File*/
$imageElement = $this->$name;
if( !empty($imageElement) )
{
$image_name = $imageElement->getFileName(null, false);
if ( !empty($image_name) )
{
@kmpm
kmpm / fabfile.py
Created September 8, 2011 15:22
Fabric deployment of Node.js on Ubuntu
from __future__ import with_statement
from fabric.api import env
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.contrib.project import upload_project
import ubuntu
import protobuf