Skip to content

Instantly share code, notes, and snippets.

@koturn
koturn / CsvParser.h
Created December 23, 2015 18:33
Simple csv parser
#ifndef CSV_PARSER_H
#define CSV_PARSER_H
/*!
* @brief Simple csv parser
* @author koturn
* @date 2015 12/24
* @file CsvParser.h
* @version 0.1
@koturn
koturn / min.vimrc
Created December 24, 2015 09:20
matchpairsのテスト用
scriptencoding utf-8
set nocompatible
set matchpairs+=(:),{:},「:」
@koturn
koturn / OptionParser.hpp
Last active January 5, 2016 03:14
Simple option parser (a wrapper of getopt)
/*!
* @brief Simple optionparser
* @author koturn
* @date 2015 12/27
* @file OptionParser.h
* @version 0.2
*/
#ifndef OPTION_PARSER_H
#define OPTION_PARSER_H
@koturn
koturn / inputcmd.vim
Last active January 3, 2016 09:41
現在のカーソルの位置にhogehogeを挿入するコマンド
function! s:inputcmd(text) abort
let [curpos, line] = [getcurpos(), getline('.')]
let line_parts = [line[: curpos[2] - 1], line[curpos[2] :]]
call setline(line('.'), line_parts[0] . a:text . line_parts[1])
endfunction
command! -nargs=* InputCmd01 call s:inputcmd(<q-args>)
command! -nargs=* InputCmd02 call feedkeys("\<Esc>a<args>", 'n')
@koturn
koturn / doremi.c
Created February 22, 2016 14:53
ドレミの歌(初心者の頃に作ったやつ)
#include <stdio.h>
#include <windows.h>
#define A 440
#define Ais 466
#define B 494
#define C 523
#define Cis 554
#define D 588
#define Dis 622
@koturn
koturn / winsubset.h
Created March 1, 2016 09:20
windows.hから余計なものを省いてインクルードするためのアレ
#ifndef WINSUBSET_H
#define WINSUBSET_H
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# define WINSUBSET_WIN32_LEAN_AND_MEAN_IS_NOT_DEFINED
# endif
# ifndef NOGDICAPMASKS
@koturn
koturn / jobtest.vim
Last active March 2, 2016 03:17
job_start()の動作確認
function! s:get_sid_prefix() abort
return matchstr(expand('<sfile>'), '^function \zs<SNR>\d\+_\zeget_sid_prefix$')
endfunction
let s:sid_prefix = s:get_sid_prefix()
delfunction s:get_sid_prefix
function! s:callback(channel, msg) abort
echo "from the handler: " a:channel . ' : ' . a:msg
endfunction
@koturn
koturn / config.vim
Created April 10, 2016 09:07
dein.vimのアレ
function! s:get_sid_prefix() abort
return matchstr(expand('<sfile>'), '^function \zs<SNR>\d\+_\zeget_sid_prefix$')
endfunction
let s:sid_prefix = s:get_sid_prefix()
delfunction s:get_sid_prefix
function! s:tes() abort
setlocal omnifunc=javacomplete#Complete
endfunction
@koturn
koturn / Makefile
Created April 10, 2016 23:22
zlibのテスト
ZLIB_DIR := ../zlib-1.2.8
ZLIB_INCS := -I$(ZLIB_DIR)
ZLIB_LDLIBS_DIR := $(ZLIB_DIR)
ZLIB_LDLIBS := -L$(ZLIB_LDLIBS_DIR) -lz
ifeq ($(DEBUG),true)
OPT_CFLAGS := -O0 -g3 -ftrapv -fstack-protector-all -D_FORTIFY_SOURCE=2
ifneq ($(shell echo $$OSTYPE),cygwin)
OPT_CFLAGS := $(OPT_CFLAGS) -fsanitize=address -fno-omit-frame-pointer
endif
@koturn
koturn / .gvimrc
Last active June 1, 2016 10:49
dein対応した.vimrc
" ============================================================
" __ __ ____
" / /______ / /___ ___________ / __ \ _
" / //_/ __ \/ __/ / / / ___/ __ \ / / / /(_)
" / ,< / /_/ / /_/ /_/ / / / / / / / /_/ / _
" /_/|_|\____/\__/\__,_/_/ /_/ /_/ \____/ ( )
" |/
"
" The setting file for GUI only.
" ============================================================