Skip to content

Instantly share code, notes, and snippets.

@guori12321
guori12321 / .vimrc.local
Created October 29, 2013 10:11
My `.vimrc.local` of `spf13`.
""""""""""" Encoding, to make sure the Chinese words looks nice
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
""""""""""" Common Setting
set wrap
set guifont=Menlo\ Regular:h28
set display=lastline
@guori12321
guori12321 / utf-8_python_file
Created October 15, 2013 02:18
how to read utf-8 file with python
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
readFile = open('test.txt', 'r')
print readFile.read()
imap <C-H> <Left>
imap <C-J> <Down>
imap <C-K> <Up>
imap <C-L> <Right>
UnBundle 'scrooloose/syntastic'
@guori12321
guori12321 / .gvimrc
Created May 3, 2013 03:23
My .gvimrc. I tried to install `Conque-Shell` via Vundle, but it showed that 'ConqueTerm: Not an edit command'.
"""""""""""""""""""""插件管理,使用Bundle
"Vundle
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" let Vundle manage Vundle
" required!
@guori12321
guori12321 / gist:4950447
Created February 14, 2013 03:38
Ray12321's gvimrc
""""""""""""""""基本设置"""""""""""""""""
"编辑非utf8文件时通过fileencoding来转码
set encoding=utf-8
"使用中文菜单,并使用 UTF-8 编码。如果没有这句的话,在非 UTF-8 的系统,如 Windows 下,用了 UTF-8 的 encoding 后菜单会乱码。
set langmenu=zh_CN.UTF-8
"使用中文提示信息,并使用 UTF-8 编码。如果没有这句的话,在非 UTF-8 的系统,如 Windows 下,用了 UTF-8 的 encoding 后系统提示会乱码。
language message zh_CN.UTF-8
@guori12321
guori12321 / Justwriting_New
Created May 30, 2015 22:12
一个为JustWriting新建中文题目博文的小脚本
#!/usr/bin/env python
import sys
import time
from pypinyin import pinyin, lazy_pinyin
import pypinyin
py = lazy_pinyin(unicode("_".join(sys.argv[1:]), "utf-8"))
fileName = ''.join(py)
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
#!/usr/bin/python
from pyPdf import PdfFileWriter, PdfFileReader
import glob
for filename in glob.glob(r'./in/*'):
print filename
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
"
" __ _ _____ _
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
" \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
" |_|
"
""""""""""" Encoding, to make sure the Chinese words looks nice
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
scriptencoding utf-8
""""""""""" Common Setting
set wrap
set guifont=Menlo\ Regular:h24
set display=lastline