Skip to content

Instantly share code, notes, and snippets.

View hustshawn's full-sized avatar
🎯
Focusing

Shawn Zhang hustshawn

🎯
Focusing
  • AWS
  • Hong Kong
View GitHub Profile
@hustshawn
hustshawn / pep20_by_example.py
Created February 29, 2016 02:10 — forked from evandrix/pep20_by_example.py
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com
@hustshawn
hustshawn / rxjs_operators_by_example.md
Created December 12, 2016 02:40 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@hustshawn
hustshawn / install_pyenv.sh
Created February 27, 2017 08:08 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@hustshawn
hustshawn / tmux.conf
Created March 7, 2017 06:41 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@hustshawn
hustshawn / email_notify.py
Created March 15, 2017 10:38 — forked from jriguera/email_notify.py
Email from Python with Jinja2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python 3 and compatibility with Python 2
from __future__ import unicode_literals, print_function
import os
import sys
import re
import logging
@hustshawn
hustshawn / nginxproxy.md
Created May 5, 2017 12:17 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hustshawn
hustshawn / brew-install-script.sh
Last active January 16, 2020 02:23 — forked from CliffordAnderson/brew-install-script.sh
Brew install script for OSX
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew install caskroom/cask/brew-cask
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import time
from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
FileTransferSpeed, FormatLabel, Percentage, \
ProgressBar, ReverseBar, RotatingMarker, \
SimpleProgress, Timer
@hustshawn
hustshawn / redis_cheatsheet.bash
Created April 19, 2018 07:59 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.