This is it.
This file contains hidden or 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
#coding = utf-8 | |
#Save to ~/rm.py(f.e.), add alias(f.e. alias rm="python ~/rm.py"), and enjoy it! | |
import sys | |
import os | |
args = sys.argv[1:] | |
filename = "" |
This file contains hidden or 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
var _p = function(i, t){ | |
// i is the input item, t is the text to set default. | |
i.onblur = function(){ | |
if( i.value === "" ){ | |
i.value = text); | |
} | |
}; | |
i.onfocus = function(){ | |
if( i.value === text ){ | |
i.value = ""; |
This file contains hidden or 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
_ = function(e){ | |
var o; | |
if(e.substr(0, 0) === "#") | |
o = document.getElementsByTagName(e); | |
else{ | |
if(e.substr(0, 0) === '.') | |
o = document.getElementsByName(e); | |
else{ | |
o = document.getElementById(e); | |
} |
This file contains hidden or 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
Bricdown是我对Markdown的改进,更方便,更便于理解. | |
语法: | |
换行 | |
不像Markdown强制双空格换行,Bricdown中换行就是换行. | |
段落 | |
视觉上的段落最后加上一个空格会被视为格式化段落. | |
标题 | |
Bricdown采用Atx风格,在行首文字前添加1~6个井号("#")代表h1~h6标签.在标题后面可以有任意个井号. | |
区块 | |
使用行首右尖括号(">").暂时不支持嵌套. |
This file contains hidden or 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
from re import compile as rc | |
#Inline Link | |
#行内链接 | |
def inline_link(text): | |
il=rc('\[(.*?)\]\((.*?)\)') | |
ret=il.findall(text) | |
for x in ret: | |
text=text.replace('[' x[0]+']('+x[1]+')','<a href="'+x[1]+'">'+x[0]+'</a>') | |
return text |
This file contains hidden or 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 re | |
at_user_filter = re.compile(r'(?:^|\W)@(\w+)') | |
email_filter = re.compile('(\w{1,63})@([A-Za-z0-9\.\-] ).(com|net|org|me|in|fm|co|biz|info|mobi|cc)') | |
#you can add suffixes by asking Google for domain suffix information. | |
url_filter = re.compile(u'((http(s|)|ftp)://|)(\w{0,}\.|)(\w{1,63}).(\w{2,4})((/((.*)|)|))') |
This file contains hidden or 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
def parseurlpara(parastr): | |
plist=parastr.split("&") | |
pdict={} | |
for item in plist: | |
itema=item.split("=") | |
pdict[itema[0]]=itema[1] | |
return pdict |
This file contains hidden or 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
title: | |
test | |
cont: | |
hello, world |
NewerOlder