Skip to content

Instantly share code, notes, and snippets.

View skychan's full-sized avatar
😿
Crying

Sky Chan skychan

😿
Crying
View GitHub Profile
@skychan
skychan / replace.sh
Created August 17, 2015 06:02
批量替换一些文件里的关键词 diufanshu -> skychan
#!/usr/bin/env bash
find GitHub/ -name config > test.config
configs=`cat test.config`
for i in $configs
do
sed -i 's/diufanshu/skychan/g' "$i"
echo "$i is done"
done
@skychan
skychan / pip.conf_douban
Last active February 15, 2017 01:33
pip config and upgrade all for me
[global]
index-url = http://pypi.douban.com/simple
no-cache-dir = false
[install]
trusted-host=pypi.douban.com
@skychan
skychan / .latexmkrc
Created February 4, 2016 15:44
The latexmkrc for mac using xelatex
$pdflatex = "xelatex -synctex=-1 %O %S";
$pdf_mode = 1;
$preview_mode = 1;
$postscript_mode = $dvi_mode = 0;
$pdf_previewer = 'open -a Preview';
@skychan
skychan / egcd.py
Created August 4, 2017 03:09
Extended Eculdiean algorithm
def egcd(a,b):
if b == 0:
return a, 1, 0
c, x, y = egcd(b, a%b)
return c, y, x - (a//b) *y
@skychan
skychan / GrabToefl.py
Created August 31, 2017 06:41
Grab definition from youdao dict and generate the word book for reviewing
import re,json,requests
from bs4 import BeautifulSoup
from bs4 import CData
import sys,os
web_url = u'http://dict.youdao.com/search?keyfrom=dict.top&q='
def readfile(s):
with open(s,'r') as f:
lines = f.readlines()
f.close()