Skip to content

Instantly share code, notes, and snippets.

View kana's full-sized avatar

Kana Natsuno kana

View GitHub Profile
@kana
kana / golf.log
Last active December 21, 2015 20:49
VimGolf - Flip the chessboard - http://vimgolf.com/challenges/50b375efd028d90002000050
First (53)
:2,$g/^/m1
7lG8ldwpggD"=join(reverse(split(@-)))
pZZ
Second (30)
:se ri
qaC-jq8@a:2,g/^/m1
ZZ
@kana
kana / hatokura.txt
Created September 12, 2013 14:27
典型的なアナスタシアの使い方
[サプライ]
早馬、検地役人、金貸し、ギルドマスター、
地方役人、密偵、ドワーフの宝石職人、見習い魔女、
伝令、交易都市
[ハンドエリミネーション]
あなた:3 枚(農村 2 枚)
CPU1:2 枚(農村 3 枚)
CPU2:2 枚(農村 3 枚)
CPU3:2 枚(農村 3 枚)
[CPU1:バランス]
@kana
kana / othello-random-ai.js
Created September 13, 2013 09:00
othello-random-ai.js
othello.registerAI({
findTheBestMove: function (gameTree) {
return gameTree.moves[Math.floor(Math.random() * gameTree.moves.length)];
}
});
@kana
kana / console.md
Created January 25, 2014 15:39
Kensington SlimBlade Trackball doesn't work on Mac OS X Mavericks

Steps to reproduce a problem:

  1. Start Safari.
  2. Open any Web page.
  3. Shift Kensington SlimBlade Trackball to View mode.
  4. Twist the ball to zoom up the page.

Result:

  • Zooming is suddgenly stopped.
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = ''
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
@kana
kana / hatokura.txt
Created May 20, 2014 13:00
えむしえれ
「オアシスの美姫エムシエレ」を擁立した時、あなたは
「オアシス都市ネフェルティリ」を獲得し、マーケットのス
タックに「禁制品トークン」3つを自由に置く。あなたのメ
インフェイズ中に、マーケットに置かれた「禁制品トーク
ン」を自由に動かしても良い。「禁制品トークン」が置かれ
たカードの購入コストはトークン1つ毎に+1される。
@kana
kana / hatokura-third-turn.rb
Last active August 29, 2015 14:02
ハトクラ第三ターン産出コイン量分布 〜六都市同盟編〜
def deck_from_spec(spec)
deck = []
spec.each do |name, count|
count.times do
deck << name
end
end
deck
end
@kana
kana / splatoon-weapon-damage.txt
Last active August 29, 2015 14:23
Splatoonブキダメージ
Splatoon ブキダメージ
ブキ 攻撃力アップ(メイン) 攻撃力アップ(サブ) 防御力アップ ダメージ
わかばシューター 0 0 0 28.0 / 56.0 / 84.0 / 112.0
わかばシューター 0 0 1 26.5 / 53.1 / 79.7 / 106.3
わかばシューター 0 0 2 25.4 / 50.8 / 76.2 / 101.6
わかばシューター 0 0 3 24.5 / 49.0 / 73.5 / 98.0 / 122.5
スプラシューター 0 0 0 36.0 / 72.0 / 108.0
スプラシューター 0 0 1 34.1 / 68.3 / 102.5
var mapped = gearSets.map(function (gearSet, i) {
var countMap = JSON.parse(JSON.stringify(required.countMap));
return {
index: i,
value: [
gearSet.shoes === anyGear ? 1 : 2,
gearSet.clothing === anyGear ? 1 : 2,
gearSet.headgear === anyGear ? 1 : 2,
countMap[gearSet.headgear.main]-- > 0 ? 1 : 2,
function! s:_GetCwordStartPos()
let cword = expand('<cword>')
let cword_pattern = '\V' . escape(cword, '\')
let cword_end_pos = searchpos(cword_pattern, 'ceW', line('.'))
let cword_start_pos = searchpos(cword_pattern, 'bcW', line('.'))
return cword_start_pos
endfunction
function! s:GuessClassName()
let cursor_pos = getpos('.')