Skip to content

Instantly share code, notes, and snippets.

\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\usepackage{geometry} % 設定邊界
\geometry{
top=1in,
inner=1in,
outer=1in,
bottom=1in,
headheight=3ex,
headsep=2ex
}
@a3linux
a3linux / gist:29ea91ce8f5cb40b1265882f8ac6374a
Created June 18, 2018 04:33 — forked from eternnoir/gist:7701964
pandoc markdown to pdf chinese template
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage{titlesec}
\titleformat{\section}{\LARGE\filcenter}{}{1em}{}
\titleformat{\subsection}{\Large\filcenter}{}{1em}{}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
ssh -i id_file
ssh -p port
when port is not standard 22
scp -P port
-P for port is not standard 22
sftp -oIdentityFile=id_rsa
to feed the identity file
https://github.com/junegunn/myvim
https://github.com/junegunn/dotfiles
https://web.archive.org/web/20120630181124/http://www.mohdshakir.net/2007/12/27/enable-vim-code-python-auto-complete
https://github.com/rkulla/pydiction
https://github.com/maxboisvert/vim-simple-complete/blob/master/plugin/vim-simple-complete.vim
vim function to use <TAB> as auto complete trigger,
function! InsertTabWrapper()
let col = col(".") - 1
if !col || getline(".")[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-n"
endfunction
#!/bin/bash
# Show difference between commits
# Usage: gdiff -n 1 <filename>
usage() {
echo "Usage: $0 -n|--commits num <filename>"
echo " Show git difference between <num> commits "
exit 1
}
ARGV=`getopt -a -o n: -l commits: -- "$@"`
https://docs.microsoft.com/en-us/outlook/rest/python-tutorial
#!/usr/bin/env python
import base64
import sys
import unittest
PY3 = sys.version_info[0] >= 3
def base64ify(bytes_or_str):
if PY3 and isinstance(bytes_or_str, str):
#!/usr/bin/env python
import argparse
import base64
def encode(key, string):
encoded_chars = []
for i in xrange(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
import aiohttp
import async_timeout
URLs = [
'https://aiohttp.readthedocs.org/',
'https://www.baidu.com/',