Skip to content

Instantly share code, notes, and snippets.

View yyfrankyy's full-sized avatar

Frank Xu yyfrankyy

View GitHub Profile
list = nil
for line in io.lines() do
list = {next=list, value=line}
end
" CSS Beauty
" 还原压缩过的CSS
" 给最后}加上;
:%s/;\@<!}/;}/g
" ;}{后加上换行
:%s/[;}{]/&\r/g
" 干掉行前的空格
{% autoescape off %}
{{ article_view.article|escape|linebreaks }}
{% endautoescape %}
/* @see http://www.w3.org/TR/CSS2/generate.html#quotes */
/* chrome(safari maybe?) does not support quote, it use ::before and :after pseudo-elements to decorate q tag */
q::after,
q::before {
content: '"'
}
/* Firefox full support quotes */
/* e.g. <span rel="book" lang="zh">I have a Dream</span> */
span[rel=book] {
/* @see http://www.w3.org/TR/CSS2/generate.html#counters */
body {
counter-reset: chapter;
}
h1:before {
content: "Chapter " counter(chapter) ". ";
counter-increment: chapter;
}
h1 {
counter-reset: section;
# 抓取wallcoo上的壁纸,起始路径为wallcoo指定分辨率的那个页面前缀
# 比如 http://www.wallcoo.com/human/Urban_Ruins_02_1920x1200/wallpapers/1680x1050/Wallcoo_com_Urban_Ruins_and_Abandoned_buildings_549cd6a00.html
# 转为 http://www.wallcoo.com/human/Urban_Ruins_02_1920x1200/wallpapers/1680x1050/
# -r 递归下载
# -nd 不分目录
# -np 不从根目录开始,只从当前目录开始遍历
# -q 安静模式
# -k 不下载外链
# -p 完整下载,这样才能找到jpg图片
wget -r -q -nd -np -p -k http://www.wallcoo.com/human/Urban_Ruins_02_1920x1200/wallpapers/1680x1050/ && rm *.html *.css *.js *.txt *.gif *.ico
// Dean Edwards/Matthias Miller/John Resig
function init() {
// quit if this function has already been called
if (arguments.callee.done) return;
// flag this function so we don't do the same thing twice
arguments.callee.done = true;
// kill the timer
# 删除空行,\s*匹配空格tab等,/d 删除
:v/\S/d
/**
* 最基本的render服务
* @example
* 语法:
* <pre>
* {key.item.item} 匹配不到不会被清除
* !{key.item.item.item} 匹配不到则留空
* </pre>
* @private
* @param {String} templ 模板
"Name" = 'JavaScript Grammar'
"Author" = 'M.Schnoor-Matriciani'
"Version" = '0.9'
"About" = 'JavaScript Grammar, Subset of ECMA Edition 3'
"Start Symbol" = <Program>
"Case Sensitive" = 'True'
! ------------------------------------------------- Sets