Skip to content

Instantly share code, notes, and snippets.

View torus's full-sized avatar
😎
Focusing

Toru Hisai torus

😎
Focusing
View GitHub Profile
diff --git a/back.scm b/back.scm
index 138e882..55f1d07 100644
--- a/back.scm
+++ b/back.scm
@@ -362,7 +362,7 @@
(instructions
`(movl ap ,target)
`(addl ,(* n ws) ap)
- `(cmpl heap_end ap)
+ `(cmpl _heap_end ap)

webchat

A tiny Ajax and comet-based chat system implemented in Scheme. Visit the project page on github.com.

REQUIREMENTS

  • Gauche 0.8.13 or later
@torus
torus / opakapaka-api.markdown
Created January 21, 2010 07:52
Opakapaka Web API.

Opakapaka API

pull.cgi

method: GET

Query parameters:

;; 第1回 Scheme コードバトン
;;
;; ■ これは何か?
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。
;; 次回 Shibuya.lisp で成果を発表します。
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。
;;
;; ■ 2 つのルール
;;
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。
;; 第1回 Scheme コードバトン
;;
;; ■ これは何か?
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。
;; 次回 Shibuya.lisp で成果を発表します。
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。
;;
;; ■ 2 つのルール
;;
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。
@torus
torus / Makefile
Created March 10, 2010 23:33
SWIG interface file for LibXML2 tree API
libxml2.so: libxml2_wrap.c
gcc -g -shared -fPIC -I/usr/include/libxml2 -o $@ $< -L/usr/lib/libxml2 -lxml2
libxml2_wrap.c: libxml2.i
swig -lua -o $@ $<
@torus
torus / lazy_dom_construction.js
Created April 17, 2010 00:49
XML DOM construction utility & DOM matcher.
// -*- indent-tabs-mode: nil -*-
// Works on both WSH and Gecko
function E_ (name, attrs) {
var children = [];
for (var i = 2; i < arguments.length; i ++) {
children.push (arguments[i]);
}
return function (doc) {
var elem = doc.createElement (name);
@torus
torus / command-key-on-nodoka.md
Created October 3, 2010 06:52
のどかで、Mac みたいなキーバインドを実現する。

のどかで、Mac みたいなキーバインドを実現する。

Ctrl キーは、Emacs 的なキーバインド。

Windows キーは、オリジナルの Windows での Ctrl キーのように振舞う。

Windows キーと Ctrl キーを区別するために、 Ctrl キーについては mod0 という新しいモディファイアとして扱うようにして、 emacsedit.nodoka ファイルを修正して、C- となっている部分をすべて M0- に置き換えた。

@torus
torus / yc.lua
Created October 23, 2010 04:42
Y Combinator in Lua
local tests = {
function ()
local function fib(n)
if n < 2 then return n end
return fib (n - 1) + fib (n - 2)
end
return fib (10)
end
;