Skip to content

Instantly share code, notes, and snippets.

View gzxultra's full-sized avatar
🍎
eating apple

Zhixiang gzxultra

🍎
eating apple
  • Seattle, WA
View GitHub Profile
@gzxultra
gzxultra / sample_nginx.conf
Last active September 13, 2017 04:38
sample_nginx
```conf
server {
listen 80;
server_name
venice-d2.xiachufang.com;
location / {
proxy_pass http://hazelnut:10080;
include proxy_params;
}
@gzxultra
gzxultra / test.py
Created September 11, 2017 09:36
test_code
d = create_delivery('哎呀,又要测试啦', 'homepage_banner_ad1', 'ad_team',419, 9999,'2017-08-07 10:00:00', '2017-09-15 00:00:00','gzx', {"mobile_website":"1","pc_website":"1","iphone":"4.0.0","android":"100"}, [], [], {"android":{"expose_tracking_url":[],"click_tracking_url":[]},"iphone":{"expose_tracking_url":[],"click_tracking_url":[]},"mobile_website":{"expose_tracking_url":[],"click_tracking_url":[]},"pc_website":{"expose_tracking_url":[],"click_tracking_url":[]}}, {'market_newbie': {'data': [3], 'operator': '>='}})
@gzxultra
gzxultra / examples for pt-online-schema-change
Last active October 30, 2017 03:00
examples for pt-online-schema-change
```shell
pt-online-schema-change \
--execute \
--no-check-alter \
--ask-pass \
--recursion-method none \
--set-vars lock_wait_timeout=3 \
--alter "change serial_code warehouse_code varchar(100) not null default ''" \
u=xcf,h=xcfapp-mysql,D=xcf_mfarm,t=fresh_warehouse
@gzxultra
gzxultra / Makefile
Created January 31, 2017 08:21
universal Makefile for C/C++ project
#### #######################################################
#
# MAKEFILE FOR C/C++ PROJECT
# Author: swm8023 <[email protected]>
# Date: 2014/01/30
#
#### #######################################################
.PHONY: all clean
all:
def zhprint(obj):
import re
print re.sub(r"\\u([a-f0-9]{4})", lambda mg: unichr(int(mg.group(1), 16)), obj.__repr__())
# coding: utf-8
import commands
import time
def get_current_ssh_user():
output = commands.getoutput('users')
return output.split(' ') if output else None
def get_current_ssh_user_set():
@gzxultra
gzxultra / check_if_file_utf_8.py
Created May 22, 2016 06:05 — forked from binderclip/check_if_file_utf_8.py
simple python script check if file utf-8 coding
import sys
def main():
if len(sys.argv) < 2:
print 'please enter file path'
file_path = sys.argv[1]
with open(file_path, 'r') as f:
s = f.read()
try: