Skip to content

Instantly share code, notes, and snippets.

hezhao

Block or report user

Report or block hezhao

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
@hezhao
hezhao / config.cson
Last active Sep 26, 2017
Atom config
View config.cson
"*":
"autocomplete-python":
extraPaths: "$PROJECT/build/sos/venv/lib/python2.7/site-packages/"
pythonPaths: "$PROJECT/build/sos/venv/bin/python"
useKite: false
useSnippets: "all"
core:
themes: [
"one-dark-ui"
"atom-dark-syntax"
@hezhao
hezhao / pdfjam.sh
Last active Mar 30, 2017
Print a PDF to N-up
View pdfjam.sh
wget http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/pdfjam/pdfjam_latest.tgz
cp pdfjam.conf ~/.pdfjam.conf
# pdflatex='/Library/TeX/texbin/pdflatex'
# paper='letterpaper'
./pdfjam --fitpaper true --nup 2x2 --delta '1mm 1mm' --scale 1.0 input.pdf --outfile output-4up.pdf
@hezhao
hezhao / linux_cmd.sh
Created Mar 6, 2017
Linux and Mac common commands
View linux_cmd.sh
# List which process is listening upon port 5000
$ lsof -i :5000
# kill command with PID 12345
$ kill -9 12345
@hezhao
hezhao / timelapse.sh
Created Feb 8, 2017
Create timelapse video from images with ffmpeg
View timelapse.sh
$ ffmpeg -framerate 60 -pattern_type glob -i 'output/*.jpg' out.mp4
@hezhao
hezhao / linear_actuator.py
Last active Dec 19, 2016
Linear Actuator Motor Control
View linear_actuator.py
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(8, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(10, GPIO.OUT, initial=GPIO.HIGH)
while (True):
@hezhao
hezhao / RPi.sh
Created Aug 13, 2016
Raspberry Pi setup commands
View RPi.sh
$ sudo raspi-config
$ sudo apt-get update
$ sudo apt-get install supervisor
@hezhao
hezhao / git_cmd.sh
Last active Mar 19, 2017
Git commands
View git_cmd.sh
# Create a new branch locally
$ git checkout -b [branch]
# Create and push the new branch to orign
$ git push origin [branch]
# Merge branch to master
$ git checkout master
$ git merge [branch]
@hezhao
hezhao / alipay.html
Created Mar 28, 2016
支付宝生活支付按钮
View alipay.html
<form action="https://shenghuo.alipay.com/send/payment/fill.htm" method="post" target="_blank" accept-charset="GBK" id="alipayForm">
<input name="optEmail" type="hidden" value="zph61@139.com" />
<input name="payAmount" type="hidden" value="1.00" />
<input id="title" name="title" type="hidden" value="捐赠给”前端技术分享”网站" />
<input name="memo" type="hidden" value="文章写的不错,支持站长,我来捐赠鼓励的!" />
<input name="pay" type="image" src="https://img.alipay.com/sys/personalprod/style/mc/btn-index.png" width="250" height="58">
</form>
@hezhao
hezhao / .zshrc
Last active Aug 11, 2018
zsh and oh-my-zsh setup script
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gitster"
# Uncomment the following line to use case-sensitive completion.
@hezhao
hezhao / heroku_cmd.sh
Last active Feb 6, 2017
Heroku Commands Cheatsheet
View heroku_cmd.sh
# https://devcenter.heroku.com/articles/getting-started-with-django
# Regions
$ heroku regions
$ heroku create --region eu
# Create
$ heroku create
$ git push heroku master
You can’t perform that action at this time.