Skip to content

Instantly share code, notes, and snippets.

@koturn
koturn / deinlist.vim
Last active August 21, 2016 08:39
dein.vimでnobundle.vimのNeoBundleListっぽいことを実現するやつ
function! s:dein_list() abort
echomsg '[dein] #: not sourced, X: not installed'
for pair in items(dein#get())
echomsg (!isdirectory(pair[1].path) ? 'X'
\ : dein#is_sourced(pair[0]) ? ' '
\ : '#') pair[0]
endfor
endfunction
command! DeinList call s:dein_list()
@koturn
koturn / innerProduct.cpp
Created July 17, 2016 09:01
Calculate inner product with SIMD instruction
#if defined(ENABLE_AVX) && !defined(__AVX__)
# error Macro: ENABLE_AVX is defined, but unable to use AVX intrinsic functions
#elif defined(ENABLE_SSE) && !defined(__SSE2__)
# error Macro: ENABLE_SSE is defined, but unable to use SSE intrinsic functions
#elif defined(ENABLE_NEON) && !defined(__ARM_NEON) && !defined(__ARM_NEON__)
# error Macro: ENABLE_NEON is defined, but unable to use NEON intrinsic functions
#else
#include <cstddef>
@koturn
koturn / .vimrc
Created July 2, 2016 08:00
dein.vimの設定の雛型
" Template of configuration with dein.vim
if has('vim_starting')
let s:deindir = expand('~/.cache/dein')
let s:deinlocal = s:deindir . '/repos/github.com/Shougo/dein.vim'
let &runtimepath = s:deinlocal . ',' . &runtimepath
endif
if dein#load_state(s:deindir)
call dein#begin(s:deindir)
call dein#add('Shougo/dein.vim')
@koturn
koturn / chakku-init01.vim
Created May 4, 2016 18:58
ちゃっくさんのinit.vimの起動を高速化!
" neobundle.vim version
set fileencoding=utf-8
set encoding=utf-8
scriptencoding utf-8
if &compatible && has('vim_starting')
set nocompatible
endif
augroup MyAutoCmd
@koturn
koturn / .gvimrc
Last active June 1, 2016 10:49
dein対応した.vimrc
" ============================================================
" __ __ ____
" / /______ / /___ ___________ / __ \ _
" / //_/ __ \/ __/ / / / ___/ __ \ / / / /(_)
" / ,< / /_/ / /_/ /_/ / / / / / / / /_/ / _
" /_/|_|\____/\__/\__,_/_/ /_/ /_/ \____/ ( )
" |/
"
" The setting file for GUI only.
" ============================================================
@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 / 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 / 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 / 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 / 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