Skip to content

Instantly share code, notes, and snippets.

View nathanphan's full-sized avatar

Ngoc Phan nathanphan

View GitHub Profile
#############################################################################
# current prompt
#############################################################################
# \d – Current date
# \t – Current time
# \h – Host name
# \# – Command number
# \u – User name
# \W – Current working directory (ie: Desktop/)
# \w – Current working directory, full path (ie: /Users/Admin/Desktop)
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"net/http"
)
@nathanphan
nathanphan / PNM-setup.txt
Created December 15, 2017 09:24
Nginx PHP7 MySQL install
sudo yum localinstall http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
sudo yum install nginx.x86_64 php70-php-fpm php70-php-cli php70-php-mysqlnd mysql-community-server --enablerepo=epel
sudo chkconfig nginx on
sudo chkconfig mysqld on
sudo chkconfig php70-php-fpm on
sudo service nginx start
sudo service mysqld start
@nathanphan
nathanphan / default.conf
Created April 2, 2018 11:48 — forked from wahyudibo/default.conf
Install nginx, php 70 (with fpm), and mysql in Mac OS X
server {
listen 80;
server_name localhost;
root /Users/wahyudibo/Projects/mylabs/php/nginx;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
@nathanphan
nathanphan / mysql_countries.sql
Created April 9, 2018 08:09 — forked from kamermans/mysql_countries.sql
MySQL Dump - continents and countries with 2 and 3 char codes, names and full names - Braintree compatible as of Dec 2011
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@nathanphan
nathanphan / simple-git-branching-model.md
Created September 25, 2020 03:39 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@nathanphan
nathanphan / Handler.java
Created November 20, 2020 04:20 — forked from lucastex/Handler.java
Reading files from Amazon S3 directly in a java.net.URL object.
package sun.net.www.protocol.s3;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import org.jets3t.service.ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;