Skip to content

Instantly share code, notes, and snippets.

View chikatoike's full-sized avatar

chikatoike chikatoike

View GitHub Profile
@chikatoike
chikatoike / neocomplcache-caching-performance.vim
Created September 13, 2012 21:45
neocomplcache caching performance
" test for https://github.com/chikatoike/neocomplcache/tree/cache-experimental
let s:sfile = globpath(&runtimepath, 'autoload/neocomplcache/async_cache.vim')
function! s:async_load_from_file(call_system, cache_dir, filename, pattern, mark)"{{{
let pattern_file_name =
\ neocomplcache#cache#encode_name('keyword_patterns', a:filename)
let cache_name =
\ neocomplcache#cache#encode_name(a:cache_dir, a:filename)
@chikatoike
chikatoike / clang_cursor_at.py
Created October 8, 2012 22:05
clang/cindex.pyの検証コード
# -*- coding: utf-8 -*-
import sys
import os
import platform
from ctypes import *
# neocomplcache-clang付属のcindex.pyを使用する
sys.path.append(os.path.expandvars('$HOMEPATH/Dropbox/home/.vim/vundle/neocomplcache-clang/autoload/neocomplcache/sources/clang_complete'))
sys.path.append(os.path.expandvars('/mnt/hgfs/work/.vim/vundle/neocomplcache-clang/autoload/neocomplcache/sources/clang_complete'))
@chikatoike
chikatoike / package_file_reload.py
Created October 18, 2012 21:53
Auto reload on save package files.
# package_file_reload.py
import os
import time
import sublime
import sublime_plugin
class PackageFileReloader(sublime_plugin.EventListener):
"""Auto reload on save package files. """
def on_post_save(self, view):
@chikatoike
chikatoike / auplugin.vim
Created November 4, 2012 11:38
過去に作った自動ロードプラグイン
if !exists('g:auplugin_disable')
let g:auplugin_disable = 0
endif
command! -nargs=1 -complete=customlist,auplugin#_complete AuLoad call s:load_plugin(<q-args>)
function! auplugin#_complete(arglead, cmdline, cursorpos)"{{{
let list = split(globpath(&runtimepath, 'auplugin/*'), '\n')
let list += split(globpath(&runtimepath, 'bundle/*'), '\n')
let rtp = map(split(&runtimepath, ','), 'expand(v:val)')
@chikatoike
chikatoike / gist:4042078
Created November 8, 2012 22:12
Vim sciprtで関数内関数的な
command! -nargs=* InnerFunction
\ let l:__func = {
\ 'type': 'function',
\ 'name': matchstr(<q-args>, '^\s*\([^(]\+\)'),
\ 'statement': [
\ 'function! <args>',
\ ' call extend(l:, get(l:, "self", {}))',
\ ],
\ }
@chikatoike
chikatoike / .vimrc
Last active December 10, 2015 09:18
" moved to https://github.com/chikatoike/config/blob/master/.vimrc
@chikatoike
chikatoike / init.el
Last active December 11, 2015 15:38
init.el
;; moved to https://github.com/chikatoike/config/blob/master/.emacs.d/init.el
@chikatoike
chikatoike / FunScriptExpress.fs
Created March 31, 2013 07:57
Using express with FunScript.
[<ReflectedDefinition>]
module Program
open FunScript
open FunScript.TypeScript
open FunScript.Compiler
// Imports
// Note: this path is relative to the directory you launched mono / monodevelop.
type ts = Api< @"../Typings/node-0.8.d.ts" >
@chikatoike
chikatoike / windows-ctrl-c.py
Created April 20, 2013 02:53
WindowsでGenerateConsoleCtrlEventを使ってctrl-cをエミュレートしてプロセスグループ全体を終了したい。 なぜかforループの2番目は子プロセスと孫プロセスが終了できない。
import sys
import time
import ctypes
import subprocess
CTRL_C_EVENT = 0
CTRL_BREAK_EVENT = 1
if len(sys.argv) == 1:
for i in range(2):
@chikatoike
chikatoike / test.c
Created July 28, 2013 02:33
growl for linux display test
/* Copyright 2011 by Yasuhiro Matsumoto
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS