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 / gist:2757649
Created May 20, 2012 10:58
从浏览器写入文件的可能性

此前有一次 P2P 文件分享的尝试, 结果浏览器操作本地文件是难点.
想法是借助 Node 转发文件流, 先用 socket.io 完成最开始的交互,
然后用 API 读取本地文件的内容, 接着文件可以被传送到接收者.
不过将文件存储下来是个问题, 而且搜索到的 API 也没有在浏览器完成.
今天再搜了下, 记一下当前对这个问题的理解:

不确定的一个方案是用 Chrome extension 完成存储的过程, 大概不会用:
http://stackoverflow.com/questions/8368745/is-it-possible-for-a-chrome-extension-to-write-to-a-file-in-chromes-system-dire

@tiye
tiye / color.styl
Created May 27, 2012 02:11
getUserMedia 捕获摄像头
body
background hsl(240,90%,90%)
video
background hsl(10,90%,90%)
@tiye
tiye / eval.coffee
Created May 28, 2012 10:17
how to interpret a lisp string
# 这个文件是上边代码的注释版本
# 这里的代码是 lispy 解释器的思路用 CoffeeScript 完成的
# lispy: http://www.googies.info/articles/lispy.html
# 实现方面有一些不同, 主要是思路, 对不同语言是要紧的
echo = console.log
err = (str) -> throw new Error str
# 代码形如 "(+ x (+ y z))" 假想作为 str 初始输入
@tiye
tiye / .markdown
Created June 3, 2012 05:10
forth 笔记
@tiye
tiye / name.md
Created June 5, 2012 08:37
DayGreen 微博植物

Gloriosa lily(百合科嘉兰)
Gloriosa lily(百合科嘉兰)


紫杉(红豆杉)
紫杉(红豆杉)


金缕梅
金缕梅

@tiye
tiye / .md
Created June 9, 2012 17:44
跳出编程语言一些想法

几天光景, 还是没有钻研编程的动力, 每天看看资源, 偶尔萌生新的想法.
当然没有数学或者编程的足够功底, 说什么都白搭, 新闻升发的观点不能当做理论.
但这些想法, 同时作为困惑, 我先记下来. 还做别人走在这, 也该这样想过.
晚上 Zed Shaw 演讲对我影响不小, 人们太懈怠于迎接未来了, 缓缓推进着技术.

@tiye
tiye / pgup.coffee
Created June 20, 2012 13:38
serve static pages up as if it's on server
#!/usr/bin/coffee
fs = require 'fs'
http = require 'http'
mime = require 'mime'
path = require 'path'
here = process.env.PWD
index = process.argv[2]
@tiye
tiye / bash.log
Created June 30, 2012 04:40
运行 aptitude 命令有 snmpd 出错..
root@testServer89:~# sudo aptitude remove nodejs npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages will be REMOVED:
libev-dev{u} nodejs nodejs-dev{u} npm rlwrap{u}
The following partially installed packages will be configured:
snmpd
@tiye
tiye / 33.html
Created July 12, 2012 07:51
双平衡三进制, IV 象限素数分布
<!doctype html>
<html>
<head>
<title>
33
</title>
<script src="33.js"></script>
</head>
<body>
<canvas id="canvas"></canvas>
@tiye
tiye / 36.css
Created July 12, 2012 07:57
36 拼音很早时候的 demo
body{
font-size:28px;
background:rgba(200,200,255,1);}
textarea{
padding:20px;
font-size:28px;
width:600px;
float:left;
height:600px;}
nav{