Skip to content

Instantly share code, notes, and snippets.

Kota Fujiwara kota

Block or report user

Report or block kota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
View gist:10652fec24611b52d225
https://github.com/kishikawakatsumi/BuildNumber
@kota
kota / ai.rb
Created Dec 9, 2014
SamurAICoding2014
View ai.rb
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 = []
View insert_property_annotation.rb
# 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
View chatwork_api.rb
# encoding: utf-8
#
# usage: ChatworkAPI.new.assign_task_to_all_members('room_id','task body')
#
require 'net/https'
require 'uri'
require 'json'
class ChatworkAPI
View .vimrc
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
@kota
kota / var_def_generator_for_as3.vim
Created Dec 3, 2011
variable, getter and setter generator for AS3
View var_def_generator_for_as3.vim
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 / .gitignore
Created Feb 10, 2012
.gitignore for flash project
View .gitignore
[project_name].swf
Thumbs.db
.DS_Store
*.swp
*-config.xml
.rvmrc
.rbenv-version
.screenrc
.rbenv-gemsets
*.swo
@kota
kota / gist:2498866
Created Apr 26, 2012
run editing rspec file with speficic line number.
View gist:2498866
function! RunSpecOnSpecificLine()
execute '! rake spec SPEC='.expand('%:p').':'.line(".")
endfunction
command! LSpec :call RunSpecOnSpecificLine()
View gist:3856189
Theorem.
There exist no 2 pairs of integers {a,b},{c,d} such that ab = cd(#1) ,a+b = c+d(#2), {a,b} != {c,d}, and a,b,c,d > 2
Proof.
Suppose we have {a,b},{c,d} that satisfies all the conditions above.
We can suppose a,b,c,d are not all equal without losing generality,
since if a = b, a^2 = cd (from #1) and 2a = c+d (from #2)
=> 4a^2 = (c+d)^2
=> 1/4(c+d)^2 = cd
You can’t perform that action at this time.