Skip to content

Instantly share code, notes, and snippets.

View chikatoike's full-sized avatar

chikatoike chikatoike

View GitHub Profile
@chikatoike
chikatoike / FloodFill.fs
Created July 28, 2013 04:53
FloodFill (WIP)
open System
open System.Windows
open System.Windows.Controls
open System.Windows.Media.Imaging
open System.Windows.Media.Effects
open System.Diagnostics
open System.Collections.Generic
let fillBmp pixels color =
Array.fill pixels 0 pixels.Length color
@chikatoike
chikatoike / Program.fs
Created July 28, 2013 04:48
F# WPF HLSL Shader
// http://blogs.msdn.com/b/hiroyuk/archive/2010/09/28/10068491.aspx
open System
open System.Windows
open System.Windows.Controls
open System.Windows.Media.Imaging
open System.Windows.Media.Effects
type MyEffect() as this =
@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
@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 / 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 / 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 / .vimrc
Last active December 10, 2015 09:18
" moved to https://github.com/chikatoike/config/blob/master/.vimrc
@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 / 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 / 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):