Skip to content

Instantly share code, notes, and snippets.

@rcmdnk
rcmdnk / jk_vim.ahk
Last active September 22, 2015 02:22
jk to enter the normal mode at ahk
j & k:: ; Go to Normal mode (for vim) with IME off even at converting.
if (VIM_IME_GET(A)) {
Send,{Esc}
Sleep 1
VIM_IME_SET()
}
VimSetMode("Vim_Normal")
Return
#!/usr/bin/env bash
#####################################################
# Install stow
#####################################################
p=stow
targz=$(curl "http://ftp.gnu.org/gnu/$p/?C=M;O=A" 2>/dev/null|
grep ".tar.gz<"|grep "$p"|grep -v "\-doc\-"|tail -n1|
awk '{split($0, tmp, "</a>")}{n=split(tmp[1], tmp2, ">")}{print tmp2[n]}')
cd ~/tmp
#!/usr/bin/env bash
# Settings {{{
TMPDIR=~/tmp
INSTALLDIR=$HOME/usr/local
STOWDIR=$HOME/usr/local/stow
IS_CLEANUP=1
XSTOW_VERSION=1.0.2
@rcmdnk
rcmdnk / screen-utf8-osc.diff
Created March 10, 2015 03:04
screen-utf8-osc.diff copied from http://zuse.jp/misc/screen-utf8-osc.diff (temporarily, as the site is not available for now)
diff --git a/src/ansi.c b/src/ansi.c
index d88e153..fc42a0a 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -1493,8 +1493,24 @@ int c;
{
if (curr->w_stringp >= curr->w_string + MAXSTR - 1)
curr->w_state = LIT;
+# ifdef UTF8
+ else if (c < 0x80)
imap <C-s> <Plug>(neosnippet_expand_or_jump)
smap <C-s> <Plug>(neosnippet_expand_or_jump)
@rcmdnk
rcmdnk / small
Last active August 29, 2015 14:11
small
@rcmdnk
rcmdnk / a.py
Created December 16, 2014 09:56
#!/usr/bin/env python
#Copyright (c) 2013 rcmdnk
import os
import sys
import httplib2
from oauth2client.file import Storage
from oauth2client.tools import run
@rcmdnk
rcmdnk / a.js
Created December 16, 2014 09:41
2
3
4
5
6
7
8
9
10
@mixin collapse-sidebar {
float: none;
width: auto;
clear: left;
margin: 0;
padding: 0 $pad-medium 1px;
background-color: lighten($sidebar-bg, 2);
border-top: 1px solid lighten($sidebar-border, 4);
section {
&.odd, &.even { float: left; width: 48%; }
@rcmdnk
rcmdnk / a.js
Created December 16, 2014 09:28
jQuery(function($){
$(document).on('copy', function(e) {
var selected = "";
if (typeof window.getSelection != "undefined") {
var sel = window.getSelection();
if (sel.rangeCount) {
var container = document.createElement("div");
for (var i = 0, len = sel.rangeCount; i < len; ++i) {
container.appendChild(sel.getRangeAt(i).cloneContents());
}