Skip to content

Instantly share code, notes, and snippets.

View tiye's full-sized avatar
💭
Make Cirru great again!

题叶 tiye

💭
Make Cirru great again!
View GitHub Profile
@tiye
tiye / diandian_模版_of_题叶
Created January 1, 2012 13:07
点点网模版
{#color:bg_color|value:"#FFA"}
{#color:link_color|value:"#FFA"}
{#color:font_color|value:"#FFA"}
{#color:date_color|value:"#FFA"}
{#color:tag_color|value:"#FFA"}
{#color:paper_color|value:"#FFA"}
{#color:current_tag_color|value:"#FFA"}
<!DOCTYPE html>
<html>
<head>
@tiye
tiye / 括号补全.py
Created January 15, 2012 13:38
极简规则自动补全 Lisp 式括号
'''
想做对于 Lisp-like 的括号自动补全, 用 py 脚本处理
先做了测试看(虽然我没学会 clj 没的测), 默认读取 file 输出 new_file
现在的定义的规则如下(其中空行被排除)
每行代码开头添加 '('
每行代码结尾, 判断缩进个数比下一行多 n 个
当 (n >= 0), 在当前行末尾添加 (n+1) 个 ')'
每行代码结尾, 如果 '(' 数 a, ')' 数 b, 下一行多 c 个缩进
若 (a-b-c) 为正, 在该行末尾添加对应个 ')'
可以有多层的缩进, 对应手动添加一次括号 '('
@tiye
tiye / name_of_this_file.coffee
Created January 29, 2012 11:36
`Garrett Flavored Markdown`编译脚本
#!/usr/bin/env coffee
# 需要`showdown`脚本, 最后加上`xports.converter = new Showdown.converter()`导出为模块
# http://github.github.com/github-flavored-markdown/scripts/showdown.js
# 然后在该目录用`$ coffee #{这个文件的名字}.coffee #{需要编译的文件名}.gfm`来运行
# 我将用作常用的工具, 但这个不知道怎么高亮语法, 没办法了, 先这样用着
style = """
body{
background: hsl(0,96%,96%);
font-size: 13px;
line-height: 26px;
@tiye
tiye / genieLearning
Created March 9, 2012 07:39
Genie 学习笔记
<html><head><title>Genie Notes</title>
<link rel="stylesheet" href="../global.css"/>
</head><body><pre>
不知道学 Genie 什么用场, 也许学后 C 阴影可以小些
教程地址 https://live.gnome.org/Genie
粗略的翻译可以看这里:
http://www.minghao.hk/bbs/read.php?tid=433
编写 Gtk 图形界面的教程这里:
https://live.gnome.org/GtkGuiTutorial
@tiye
tiye / schemeLearning
Created March 9, 2012 07:40
Scheme 学习笔记
在线版本:
http://docview.cnodejs.net/leaf/notes/scheme/scheme.lx?lx
打算学`Scheme`, 搜了不少尝试去理解, 中文资源不如`JS`多
`IBM`社区`5+`篇文章, 下面两篇介绍语法方面比较清晰
http://www.ibm.com/developerworks/cn/linux/l-schm/index1.html
http://www.ibm.com/developerworks/cn/linux/l-schm/index2.html
关于历史掌故可以看下面这篇了解下, 比较乱, 我没有细看
http://blog.chinaunix.net/space.php?uid=20106293&do=blog&id=142113
`scm`的规范简介有力, 真的很短, 入门后去看下
@tiye
tiye / nodejsLearning
Created March 9, 2012 07:43
nodejs 学习笔记
<html>
<head>
<title>Node.js Guide CoffeeScript</title>
<link rel="stylesheet" href="m.css"/>
</head>
<body>
<pre><code>
Node.Js 入门以及中文翻译:
http://nodebeginner.org/index.html
http://nodebeginner.org/index-zh-cn.html
@tiye
tiye / client.coffee
Created April 3, 2012 01:52
A Node demo to run browserid with `https` module
image = document.getElementById 'login'
ll = (v...) ->
console.log v
socket = io.connect window.location.hostname
socket.on 'ready', (data) ->
ll data
image.onclick = ->
@tiye
tiye / token.coffee
Created April 9, 2012 06:01
sibliantjs 解释 S 表达式
# code from https://github.com/jbr/sibilant/blob/a5d43850eeb86d7859b04016e955a02690246f20/speech_therapist.js
ll = console.log
plat = (arr) ->
str = ''
arr = arr.map (x) ->
if typeof x is 'object'
return plat x
else return x
return "[#{arr.join ' '}]"
@tiye
tiye / main.html
Created April 13, 2012 07:19
Error: `Not allowed to load local resource: file:///home/chen/code/home/git/docview/libs/coffee-script.js`
<html>
<head>
<script type='text/coffeescript'>
console.log 'loaded!'
</script>
<script src='file:/home/chen/code/home/git/docview/libs/coffee-script.js'></script>
</head>
<body></body>
</html>
@tiye
tiye / coffee ugo_reset.coffee
Created April 22, 2012 02:59
reset the fole modes after reinstall Ubuntu
# this is a CoffeeScript file
# put this file at the top level of file tree
# run with 'coffee ugo_reset.coffee'
fs = require 'fs'
path = require 'path'
ll = console.log
list_files = (dir_name) ->
files = fs.readdirSync dir_name