Skip to content

Instantly share code, notes, and snippets.

@kota
kota / .gitignore
Created February 10, 2012 05:45
.gitignore for flash project
[project_name].swf
Thumbs.db
.DS_Store
*.swp
*-config.xml
.rvmrc
.rbenv-version
.screenrc
.rbenv-gemsets
*.swo
@kota
kota / var_def_generator_for_as3.vim
Created December 3, 2011 18:51
variable, getter and setter generator for AS3
function! DefSetter(name,type)
return "public function set " . a:name . "(v:" . a:type ."):void{ _" . a:name ." = v; }"
endfunction
function! DefGetter(name,type)
return "public function get " . a:name . "():" .a:type . "{ return _" . a:name ."; }"
endfunction
function! DefPrivateVariable(name,type)
return "private var _" . a:name . ":" .a:type . ";"
@kota
kota / .vimrc
Created January 18, 2011 09:24
syntax on
set autoindent
set tabstop=2
set softtabstop=2
set expandtab
set laststatus=2
set statusline=[%L]\ %t\ %y%{'['.(&fenc!=''?&fenc:&enc).':'.&ff.']'}%r%m%=%c:%l/%L
filetype on
filetype plugin on
# encoding: utf-8
#
# usage: ChatworkAPI.new.assign_task_to_all_members('room_id','task body')
#
require 'net/https'
require 'uri'
require 'json'
class ChatworkAPI
# usage: ruby insert_property_annotation.rb < file
lines = STDIN.readlines
lines.each do |line|
if !(line =~ / class /) && line =~ /(\s+?)(public|private) (.+?) (.+?)[\s;]/
puts %W(#{$1}@property("#{$4.underscore}"))
puts line
else
puts line
end
@kota
kota / ai.rb
Created December 9, 2014 04:03
SamurAICoding2014
class SamuraiAi
def read_game_info
@total_turns,@num_daimyos,@num_lords = self.read_integers
@military_strength = self.read_integers
end
def read_turn_info
@turn,@time = STDIN.gets.split(' ')
@turn = @turn.to_i
@ints = []
https://github.com/kishikawakatsumi/BuildNumber
@kota
kota / .vimrc
Last active August 29, 2015 14:06
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))