Skip to content

Instantly share code, notes, and snippets.

View luztak's full-sized avatar

Luztak Mozill luztak

View GitHub Profile
@luztak
luztak / rm.py
Created April 4, 2013 15:05 — forked from anonymous/rm.py
#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 = ""
@luztak
luztak / placeholder.js
Created January 30, 2013 06:18
A simple placeholder simulator for IE.
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 = "";
@luztak
luztak / write.rst
Last active December 11, 2015 22:39
reStructedText writing test

Title between "="

This is it.

Title between "-"

@luztak
luztak / README.rst
Last active December 11, 2015 20:09
parguments README.rst

parguments

Parguments is a simple yet elegant command line argument parser , written in and written for Python.

Howto

@luztak
luztak / ink.js
Last active October 7, 2015 11:47
InkJS
_ = 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);
}
@luztak
luztak / bdsyntax.txt
Created July 21, 2012 16:36
Bricdown Syntax Documentation(temp.)
Bricdown是我对Markdown的改进,更方便,更便于理解.
语法:
换行
不像Markdown强制双空格换行,Bricdown中换行就是换行.
段落
视觉上的段落最后加上一个空格会被视为格式化段落.
标题
Bricdown采用Atx风格,在行首文字前添加1~6个井号("#")代表h1~h6标签.在标题后面可以有任意个井号.
区块
使用行首右尖括号(">").暂时不支持嵌套.
@luztak
luztak / meda.py
Created July 10, 2012 02:06
Markdown parsing library in pure Python(md2html). 纯Python编写的Markdown解析库.
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
@luztak
luztak / namere.py
Created July 2, 2012 18:56
RegEx for [at] and urls.
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})((/((.*)|)|))')
@luztak
luztak / urlparaparser.py
Created June 26, 2012 08:53
Parse url parameters into dict.
def parseurlpara(parastr):
plist=parastr.split("&")
pdict={}
for item in plist:
itema=item.split("=")
pdict[itema[0]]=itema[1]
return pdict
@luztak
luztak / test.yml
Created June 6, 2012 05:46
Yaml test
title:
test
cont:
hello, world