Skip to content

Instantly share code, notes, and snippets.

View kana's full-sized avatar

Kana Natsuno kana

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Usage: xsltproc cho45-problem.xslt cho45-problem.xslt
Problem: http://twitter.com/cho45/statuses/874759595
From "3.4 Booleans"
in "XML Path Language (XPath) Version 1.0 W3C Recommendation 16 November 1999"
<http://www.w3.org/TR/1999/REC-xpath-19991116>,
When neither object to be compared is a node-set and the operator is <=, <,
require 'rubygems'
require 'highline/import'
require 'mechanize'
agent = WWW::Mechanize.new
login_page = agent.get 'http://www.vim.org/login.php'
_ = ask 'user'
pp _
__END__
@kana
kana / rfunc.vim
Created September 14, 2008 08:50
" Vim global plugin for R user
" Last Change: 2008 Sep 14
" Maintainer: Takao Yokoyama <[email protected]>
" License: This file is placed in the public domain.
if exists('g:loaded_rfunc')
finish
endif
let g:loaded_rfunc = 1
@kana
kana / gist:14316
Created October 2, 2008 08:49 — forked from yoppi/gist:14313
yoppiblog's problem
" quickrun - run a command and show its result quickly
" Author: ujihisa <http://ujihisa.nowa.jp/>
" ModifiedBy: kana <http://whileimautomaton.net/>
if exists('g:loaded_quickrun')
finish
endif
--- Align.vba.orig 2009-10-09 17:11:21.000000000 +0900
+++ Align.vba 2008-10-09 17:10:56.000000000 +0900
@@ -96,7 +96,7 @@
if !hasmapto('<Plug>WrapperStart')
nmap <unique> <SID>WS <Plug>AlignMapsWrapperStart
endif
-nmap <silent> <script> <Plug>AlignMapsWrapperStart :set lz<CR>:call AlignWrapperStart()<CR>
+nnoremap <silent> <Plug>AlignMapsWrapperStart :set lz<CR>:call AlignWrapperStart()<CR>
" ---------------------------------------------------------------------
to upper(aString)
set UPPERCASE to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set theResult to characters of aString
repeat with aChar in theResult
set i to offset of aChar in UPPERCASE
if i is not 0 then
set contents of aChar to character i of UPPERCASE
end if
end repeat
return theResult as text
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