Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# ./switchbot-plug-mini <ble-addr> [<state>]
#
# state:
# None: Get the current state
# 0: OFF
# 1: ON
# -1: TOGGLE
"
" Settings
"
let fullpagescrollpercent = 95
let scrollduration = 20
"
" Mappings
"
@anyakichi
anyakichi / kiklib-configure.patch
Created December 9, 2013 13:31
mlterm fix for Mac OS X
--- kiklib/configure.orig 2013-03-23 21:40:00.000000000 +0900
+++ kiklib/configure 2013-04-15 19:58:13.000000000 +0900
@@ -19839,7 +19839,7 @@
DL_LIBS="${DL_LIBS} ${lt_cv_dlopen_libs}"
# NSLinkModule (darwin)
ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule"
-if test "x$ac_cv_func_NSLinkModule" = x""yes; then :
+if test "$DL_LOADER" = none && test "x$ac_cv_func_NSLinkModule" = x""yes; then :
DL_LOADER=dyld
@anyakichi
anyakichi / taskpaper.vim
Created June 24, 2012 08:22
unite-outline source for taskpaper
function! unite#sources#outline#taskpaper#outline_info()
return s:outline_info
endfunction
let s:outline_info = {
\ 'heading': '^.\+:\(\s\+@[^ \t(]\+\(([^)]*)\)\?\)*$'
\ }
function! s:outline_info.create_heading(which, heading_line, matched_line, context)
let heading = {
@anyakichi
anyakichi / gist:2982373
Created June 24, 2012 08:01
Show differences to be committed for hg and svn
nnoremap <Space>D :<C-u>call <SID>commit_diff()<CR>
function! s:commit_diff(...)
let mod = a:0 > 0 ? a:1 : '' " 'vertical' or 'tab'
if bufname('%') =~ 'hg-editor-\w\+.txt'
call s:hg_commit_diff(mod)
elseif bufname('%') =~ 'svn-commit\%(\.\d\+\)\?\.tmp$'
call s:svn_commit_diff(mod)
else
@anyakichi
anyakichi / flowchart.diag
Created January 9, 2012 11:30
flowchart sample
blockdiag {
orientation = portrait
A [label = "cond", shape = "diamond"];
A -> B [label = "yes"];
A -> C [label = "no"];
}
diff -ur multiskkserv-20100128-ac.orig/src/multiskkserv.c multiskkserv-20100128-ac/src/multiskkserv.c
--- multiskkserv-20100128-ac.orig/src/multiskkserv.c 2011-10-02 13:28:12.000000000 +0900
+++ multiskkserv-20100128-ac/src/multiskkserv.c 2011-10-02 13:28:21.000000000 +0900
@@ -263,6 +263,128 @@
#endif
}
+static int
+join(char *buf, int maxlen, char *sep, char **list)
+{
@anyakichi
anyakichi / aquaskk-sticky-key.patch
Created September 26, 2011 15:43
sticky key support for AquaSKK
Index: src/engine/state/SKKEvent.h
===================================================================
--- src/engine/state/SKKEvent.h (revision 157)
+++ src/engine/state/SKKEvent.h (working copy)
@@ -71,7 +71,8 @@
PrevCandidate = (1 << 11),
RemoveTrigger = (1 << 12),
InputChars = (1 << 13),
- CompConversion = (1 << 14)
+ CompConversion = (1 << 14),
@anyakichi
anyakichi / uim-skk-sticky-key.patch
Created September 26, 2011 03:16
sticky key support for uim-skk
diff -ur uim-1.7.0.orig/scm/skk-key-custom.scm uim-1.7.0/scm/skk-key-custom.scm
--- uim-1.7.0.orig/scm/skk-key-custom.scm 2011-09-26 12:13:46.000000000 +0900
+++ uim-1.7.0/scm/skk-key-custom.scm 2011-09-26 11:27:53.000000000 +0900
@@ -140,6 +140,12 @@
(N_ "[SKK] cancel")
(N_ "long description will be here"))
+(define-custom 'skk-sticky-key '()
+ '(skk-keys1)
+ '(key)
@anyakichi
anyakichi / histsearch.vim
Created July 28, 2011 15:31
history search plugin for vim
" History search plugin
if exists("g:loaded_histsearch")
finish
endif
let g:loaded_histsearch = 1
let s:cpo_save = &cpo
set cpo&vim