Skip to content

Instantly share code, notes, and snippets.

Thomanphan Thomanphan

Block or report user

Report or block Thomanphan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Thomanphan /
Created Jul 31, 2018 — forked from edm00se/
Sample nginx.conf settings to perform reverse proxy functionality to.

Read Me

In order to access a server hosted within a vm (guest), for development purposes from the host OS, which is restricted to same origin / localhost only requests, I set up a siple nginx reverse proxy to forward my requests.


  1. To install in a Windows VM, download and install nginx from the current, stable release; I installed to C:\nginx\
  2. Edit the <install path>/conf/nginx.conf file with the marked changes in the file of the same name in this gist.
  3. Start the nginx executable, located in your install path. There are service wrappers for Windows, or you can just kill the process to stop the nginx instance.

Commands for Windows

Thomanphan /
Created Jul 24, 2018 — forked from joerx/
redirect php-fpm output to nginx's error log
  • php process is wrapped like this: PHP file -> php-fpm -> nginx
  • basically means disable all facilities that catch output from the script on it's way to nginx
  • standard error output will the end in Nginx's logging facility

On CentOS

  • make sure your script does not set error_log
  • edit /etc/php-fpm.conf, disable line error_log = /var/log/php-fpm/error.log
  • edit /etc/php-fpm.d/www.conf, disable line starting with php_admin_value[error_log] = ...
  • restart fpm: systemctl restart php-fpm
View ssl-protocol-cipher.conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
View nginx.cnf
server {
listen 80;
rewrite ^(.*)$1 permanent;
server {
listen 443 ssl http2;
ssl_certificate /etc/nginx/paidssl/;
Thomanphan / svg2icns
Created May 20, 2018 — forked from zlbruce/svg2icns
covert svg to icns (with imagemagick)
View svg2icns
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
echo "processing: $name"
View gist:6bee985f71f342a773b9d829ee8ab208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xml:lang="en" lang="en" xmlns="">
<title>[VIP Exclusive] Gael Breton, Perrin Carrell – The Authority Site System $497</title>
<script src="/cdn-cgi/apps/head/yWhojLTrnH_uPURAVzoPEG9BKrM.js"></script><script type="text/javascript">
window.__cfRocketOptions = {byc:0,p:0,petok:"8ed06bfd0e09014cd52fcaddcb51474fc2d1b0ba-1524819050-1800"};
View gist:7af842360e2bd4f370c22b07f328f5a9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xml:lang="en" lang="en" xmlns="">
<title>(GET) Persuasion Secrets of the World’s Most Charismatic and Influential Villains by Ben Settle</title>
<script src="/cdn-cgi/apps/head/yWhojLTrnH_uPURAVzoPEG9BKrM.js"></script><script type="text/javascript">
window.__cfRocketOptions = {byc:0,p:0,petok:"5ebaaa8dc2a7856d2056f97e9565b6ce6a9000be-1524818515-1800"};
Thomanphan / ResizeImage.php
Created Mar 26, 2018 — forked from egulhan/ResizeImage.php
Resize Image Class With PHP
View ResizeImage.php
// @source:
* Resize image class will allow you to resize an image
* Can resize to exact size
* Max width size while keep aspect ratio
* Max height size while keep aspect ratio
* Automatic while keep aspect ratio
View Fahrenheit to Celsius.html
<!DOCTYPE html>
<h2>JavaScript Functions</h2>
<p>This example calls a function to convert from Fahrenheit to Celsius:</p>
<p id="demo"></p>
function toCelsius(f) {
You can’t perform that action at this time.