Skip to content

Instantly share code, notes, and snippets.

View zjyExcelsior's full-sized avatar

Zhu Jiongyao zjyExcelsior

View GitHub Profile
@zjyExcelsior
zjyExcelsior / change_git_history.sh
Created April 22, 2016 09:43
The script to change the Git history of my repository.
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@zjyExcelsior
zjyExcelsior / 2016.4.25.md
Last active April 24, 2016 17:01
OS X 10.11下,执行`virtualenv venv`命令出错的解决方法

OS X 10.11下,执行virtualenv venv,提示

Operation not permitted: '/usr/local/bin/easy_install'之类错误

解决方法为:rm -rf .pydistutils.cfg

@zjyExcelsior
zjyExcelsior / basic.html
Created May 2, 2016 11:46
Basic template for html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
@zjyExcelsior
zjyExcelsior / addpath.py
Last active May 2, 2016 15:18
在当前目录下,将该目录下的package文件夹路径添加到系统路径中
#coding=utf-8
import os
import sys
curdir = os.path.dirname(os.path.realpath(__file__))
sys_paths = []
sys_paths.append(os.path.join(curdir, "packages"))
for p in sys_paths:
sys.path.insert(0, p)
@zjyExcelsior
zjyExcelsior / switch.py
Last active May 11, 2016 08:04
A replacement method for switch statement in Python
# coding: utf-8
def switch(item):
return {
'one': 1,
'two': 2,
'three': 3
}.get(item, 0)
if __name__ == '__main__':
print switch('one')
@zjyExcelsior
zjyExcelsior / u_can_u_up.py
Created July 20, 2016 15:48
`UCloud`活动 -> `UCanUup`
# coding: utf-8
import requests
URL = '''http://106.75.28.160/UCloud.txt#rd?sukey=3997c0719f1515206fcb3e208377fb04c629d5538daaa1eb8062a8dd668ceb37a14e5b49042e5f785681b5d06d1cbc61'''
def count_this(word_to_find):
r = requests.get(URL)
return r.content.count(word_to_find)
@zjyExcelsior
zjyExcelsior / sublime_imfix.c
Created September 16, 2016 14:54
fix the Chinese input in Sublime Text in Ubuntu
/*
sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang <jianzhong.huang at i-soft.com.cn>
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
LD_PRELOAD=./libsublime-imfix.so sublime_text
*/
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
@zjyExcelsior
zjyExcelsior / LICENCE SUBLIME TEXT
Created November 14, 2017 02:56
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@zjyExcelsior
zjyExcelsior / tmux-cheatsheet.markdown
Created December 28, 2017 03:26 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@zjyExcelsior
zjyExcelsior / gist:482d290e7b62c904cdf8f545c2e119e2
Created March 6, 2018 05:59 — forked from tkaemming/gist:5640332
documentation on _threading_local
Help on module _threading_local:
NAME
_threading_local - Thread-local objects.
FILE
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_threading_local.py
MODULE DOCS
http://docs.python.org/library/_threading_local