This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @require http://svn.coderepos.org/share/lang/javascript/jsdeferred/trunk/jsdeferred.js | |
function callcc (fun) { | |
var error = new Deferred(); | |
return call(function () { | |
// JSDeferred は this に現在実行中の Deferred オブジェクトをいれてくる。 | |
var ccdeferred = this; | |
// 継続 (Deferred) に値を注入する関数 (Scheme の継続みたいなの) を渡してやる。 | |
return fun(function (a) { ccdeferred._next.call(a); throw error }); | |
}). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Render SVG Arc with canvas commands | |
Usage: solveArc(x, y, coords) | |
*/ | |
function solveArc(x, y, coords) { | |
var rx = coords[0] | |
var ry = coords[1] | |
var rot = coords[2] | |
var large = coords[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set tabline=%!SetTabLine() | |
function! SetTabLine() | |
" NOTE: left/right padding of each tab was hard coded as 1 space. | |
" NOTE: require Vim 7.3 strwidth() to display fullwidth text correctly. | |
" settings | |
let tabMinWidth = 0 | |
let tabMaxWidth = 40 | |
let tabMinWidthResized = 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Swap window without moving cursor {{{ | |
nmap <Space>j <SID>(swap-window-down-no-cursor-move) | |
nmap <Space>k <SID>(swap-window-up-no-cursor-move) | |
nmap <Space>h <SID>(swap-window-left-no-cursor-move) | |
nmap <Space>l <SID>(swap-window-right-no-cursor-move) | |
nnoremap <SID>(swap-window-down-no-cursor-move) :<C-u>call <SID>swap_with_wincmd(v:count1, 'j')<CR> | |
nnoremap <SID>(swap-window-up-no-cursor-move) :<C-u>call <SID>swap_with_wincmd(v:count1, 'k')<CR> | |
nnoremap <SID>(swap-window-left-no-cursor-move) :<C-u>call <SID>swap_with_wincmd(v:count1, 'h')<CR> | |
nnoremap <SID>(swap-window-right-no-cursor-move) :<C-u>call <SID>swap_with_wincmd(v:count1, 'l')<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exists("g:loaded_nerdtree_unite_filerec") | |
finish | |
endif | |
let g:loaded_nerdtree_unite_filerec = 1 | |
if !exists(':Unite') | |
echoerr 'This plugin requires unite.vim' | |
finish | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this does not run as a complete script :( | |
pkg_add -r bash curl sudo | |
pkg_add -r git vim # can you live without it? | |
pkg_add -r libxml2 libxslt # for nokogiri later | |
pw usermod pzol -G wheel | |
bash # start bash and run the rest inside it | |
curl -# -L http://bit.ly/rvm-install-system-wide > rvm-install-system-wide | |
bash -l < rvm-install-system-wide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e = new (require("events").EventEmitter) | |
e.on("newListener", function (ev, fn) { | |
console.error(e.listeners(ev)) | |
console.error("During: listeners.length = %d", e.listeners(ev).length) | |
}) | |
console.error("Before: listeners.length = %d", e.listeners("foo").length) | |
e.on("foo", function () {}) | |
console.error(e.listeners("foo")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### MATPLOTLIBRC FORMAT | |
# This is a sample matplotlib configuration file - you can find a copy | |
# of it on your system in | |
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it | |
# there, please note that it will be overridden in your next install. | |
# If you want to keep a permanent local copy that will not be | |
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux | |
# like systems) and C:\Documents and Settings\yourname\.matplotlib | |
# (win32 systems). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window,undefined){ | |
// Prepare our Variables | |
var | |
document = window.document, | |
$ = window.jQuery; | |
// Wait for Document | |
$(window).bind(function(){ | |
// Prepare Variables |
OlderNewer