Skip to content

Instantly share code, notes, and snippets.

View ik0r's full-sized avatar
🖥️
Happy coding 🎉

ik0r

🖥️
Happy coding 🎉
View GitHub Profile
git filter-branch -f --env-filter '
OLD_EMAIL="old@example.com"
CORRECT_NAME="name"
CORRECT_EMAIL="new@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
@ik0r
ik0r / gitstars.json
Created February 6, 2018 03:37
github stars manager for production
{"tags":[],"lastModified":1517888234435}
var spell = {"a": "\u554a\u963f\u9515", "ai": "\u57c3\u6328\u54ce\u5509\u54c0\u7691\u764c\u853c\u77ee\u827e\u788d\u7231\u9698\u8bf6\u6371\u55f3\u55cc\u5ad2\u7477\u66a7\u7839\u953f\u972d", "an": "\u978d\u6c28\u5b89\u4ffa\u6309\u6697\u5cb8\u80fa\u6848\u8c19\u57ef\u63de\u72b4\u5eb5\u6849\u94f5\u9e4c\u9878\u9eef", "ang": "\u80ae\u6602\u76ce", "ao": "\u51f9\u6556\u71ac\u7ff1\u8884\u50b2\u5965\u61ca\u6fb3\u5773\u62d7\u55f7\u5662\u5c99\u5ed2\u9068\u5aaa\u9a9c\u8071\u87af\u93ca\u9ccc\u93d6", "ba": "\u82ad\u634c\u6252\u53ed\u5427\u7b06\u516b\u75a4\u5df4\u62d4\u8dcb\u9776\u628a\u8019\u575d\u9738\u7f62\u7238\u8307\u83dd\u8406\u636d\u5c9c\u705e\u6777\u94af\u7c91\u9c85\u9b43", "bai": "\u767d\u67cf\u767e\u6446\u4f70\u8d25\u62dc\u7a17\u859c\u63b0\u97b4", "ban": "\u6591\u73ed\u642c\u6273\u822c\u9881\u677f\u7248\u626e\u62cc\u4f34\u74e3\u534a\u529e\u7eca\u962a\u5742\u8c73\u94a3\u7622\u764d\u8228", "bang": "\u90a6\u5e2e\u6886\u699c\u8180\u7ed1\u68d2\u78c5\u868c\u9551\u508d\u8c24\u84a1\u8783", "bao": "\u82de\u80de\u5305\u8912\u9
@ik0r
ik0r / svn2git.sh
Created January 4, 2014 03:35
放在svn目录中,执行 ./svn2git.sh > author.txt 或者 ./svn2git2.sh > author.txt 得到所有提交者的信息,然后修改author.txt中等号后面的信息 在使用git-svn迁移项目时,使用 --authors-file=author.txt导入提交者信息
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = ${author} email@example.com";
done
@ik0r
ik0r / Find.py
Created January 4, 2014 02:40
查找某个目录及子目录中的重复文件,速度极快 find.py {dir}
#!/usr/bin/env python
#-*-coding=utf-8-*-
# by oneleaf@ubuntu-cn
import binascii,os,sys
"""
查找某个目录及子目录中的重复文件,速度极快
"""
filesizes={}
samefiles=[]