Skip to content

Instantly share code, notes, and snippets.

View kana's full-sized avatar

Kana Natsuno kana

View GitHub Profile
def local(*args)
yield *args
end
x = 100
local 200 do |x|
p x #==> 200
end
p x #==> 100 (1.9) or 200 (1.8)
/* http://d.hatena.ne.jp/yaotti/20090330/1238391711 */
#include <stdio.h>
#include <stdlib.h>
/* structure inside queue like atoms of a list */
typedef struct atom_t{
" Swap the meanings of ";" and ":" keys.
" This swapping is not applied while you inserting text.
noremap ; :
noremap : ;
@kana
kana / c.vim
Created May 2, 2009 09:03 — forked from mootoh/c.vim
" c.vim
" Syntax Highlight Rule for 'KRDS': stands for KoRe ha DaSai, similar to FIXME
" install this by putting it as ~/.vim/after/syntax/c.vim
syn keyword cTodo contained TODO FIXME XXX KRDS
" ku - An interface for anything
" Version: 0.2.2
" Copyright (C) 2008-2009 kana <http://whileimautomaton.net/>
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
edit k
append
vim: set nrformats=hex number :
.
write
edit
setlocal nrformats? number? " ==> nrformats=hex number
split
setlocal nrformats=
%substitute/number/nonumber/
#include <stdio.h>
typedef struct Greeter
{
struct Greeter (*hello)(const char*);
} Greeter;
Greeter hello(const char *name);
vim -u NONE -c 'source test.vim'
YUKI.N> git clone git://github.com/kana/config.git
YUKI.N> cd config
YUKI.N> git checkout vim-operator-replace-bug-char-vs-char-case-1
YUKI.N> make PACKAGE_NAME=vim-operator-replace test-a-package
TEST: test/vim-operator-replace/basic ... FAILED
--- test/vim-operator-replace/basic.expected 2009-09-06 17:57:31.000000000 +0900
+++ test/vim-operator-replace/basic.output 2009-09-06 17:57:07.000000000 +0900
@@ -29,7 +29,9 @@
TEST: getline(1, line('$')) ==> text ... ok
TEST: [line('.'), col('.')] ==> [1, 7] ... ok
@kana
kana / Result
Created September 6, 2009 23:29
1.065487
0.933179
0.843261
0.705416