This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ============= " | |
" filetype.vim " | |
" ============= " | |
au BufNewFile,BufRead slide setf slide.rst | |
au BufNewFile,BufRead *.slide setf slide.rst.todo | |
" =================== " | |
" ftplugin/slide.vim " | |
" =================== " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=============== | |
Vim Plugin 簡介 | |
=============== | |
如何自幹一個 Vim Plugin | |
(我猜 10 分鐘就會結束了) | |
池昌言 pi314 拍拍 | |
CCCA x SITCON 定期聚 @ 2015/10/14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [3, 14, 11, 14, 17, 8, 20, 12, 3, 14] | |
b = [7, 4, 11, 11, 14] | |
c = [2, 7, 4, 2, 10, 8, 14, 2, 7, 4, 2, 10, 8, 14, 2, 7] | |
d = [1, 1, 1, 1, 1, 1, 1] | |
def foo(seq): | |
for ret in range(1, len(seq)): | |
for i, _ in enumerate(seq[ret:]): | |
if seq[i + ret] != seq[i % ret]: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' # my virtualenv settings, use with caution | |
$ virtualenv-2.7 .venv-openmtc-r4 | |
$ source .venv-openmtc-r4/bin/activate | |
$ pip instal --upgrade openmtc-all-4.0.2.tar.gz | |
$ vim .venv-openmtc-r4/lib/python2.7/site-packages/etc/openmtc/gevent/config-gscl.json.dist | |
"file": "/var/log/gscl.log" | |
-> | |
"file": "./gscl.log" | |
$ \python -m openmtc_gevent.gscl_main -f .venv-openmtc-r4/lib/python2.7/site-packages/etc/openmtc/gevent/config-gscl.json.dist | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#ifdef ofst | |
for i in range(12): | |
MID, ofst, _ = 12, lambda o, i: int(o[i], 16), """ | |
#else | |
#define ofst(o, i) 0 | |
int main () { int t; char *s, *_; for (int i = 0; i < 12; i++) { | |
s = " """; | |
t = (int)(9+(i%3+(int)(i/3))*2-(i>8)*(2*(i-8)+2)) + ofst("466975754C32", i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def main(): | |
results = {} | |
results['OO'] = 0 | |
results['OX'] = 0 | |
results['XO'] = 0 | |
results['XX'] = 0 | |
for i in range(10000): |