Skip to content

Instantly share code, notes, and snippets.

View torus's full-sized avatar
😎
Focusing

Toru Hisai torus

😎
Focusing
View GitHub Profile
// https://github.com/angular/angular.js/blob/d3b1f502e3099d91042a1827a006ad112ea67d36/src/auto/injector.js#L98
fnText = fn.toString().replace(STRIP_COMMENTS, '');
argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
arg.replace(FN_ARG, function(all, underscore, name) {
$inject.push(name);
});
});
Process: BlueMarsLite [31785]
Path: /Users/USER/Downloads/BlueMarsLite.app/Contents/MacOS/BlueMarsLite
Identifier: com.yourcompany.BlueMarsLite
Version: ???
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: BlueMarsLite [31785]
User ID: 501
Date/Time: 2014-11-08 12:54:45.935 +0900
// 15.4-1
var x = [null, 1, 0, 0, 1, 0, 1, 0, 1]
var y = [null, 0, 1, 0, 1, 1, 0, 1, 1, 0]
function lcs_length(x, y) {
var m = x.length - 1
var n = y.length - 1
var b = []
@torus
torus / .emacs
Last active December 15, 2015 14:09
;; -*- coding: utf-8 -*-
(global-set-key "\C-h" 'backward-delete-char)
(global-set-key "\M-o" 'other-window)
(global-set-key "\C-c\C-c" 'comment-region)
;; Quick brown fox
;; 東京は美しいの街
(add-to-list 'load-path (expand-file-name "~/local/site-lisp/yatex1.77"))
@torus
torus / deep_c.md
Created October 9, 2012 05:53
Deep C (and C++) by Olve Maudal and Jon Jagger
function zero(str) {
var m
if (m = str.match(/^0(?!\d)(.*)/)) {
return m[1]
}
throw "zero"
}
function decimal(str) {
var m
echo call_user_func(call_user_func(function ($func) {
return call_user_func(function ($f) use ($func) {
return call_user_func(function ($g) use ($f) {
return function ($n) use ($f, $g) {
return call_user_func($g($f($f)), $n);
};
}, $func);
}, function ($f) use ($func) {
return call_user_func(function ($g) use ($f) {
return function ($n) use ($f, $g) {
@torus
torus / match-renshu.scm
Created June 6, 2012 08:12
util.match の練習。
(use util.match)
(define tree
'((((1 2 3) (4 5) 6) ((7 8) 9 (10 11 12))) 13))
(define (match-tree t)
(match t
((? number? n)
(print "number " n))
((children ...)
@torus
torus / vcs.als
Created May 13, 2012 09:32 — forked from halcat0x15a/vcs
start alloy
sig Repository {
file: set File
}
fact {
all rep: Repository |
no disj f1, f2: rep.file | f1.path = f2.path
}