Skip to content

Instantly share code, notes, and snippets.

@ik9999
ik9999 / sshfs.sh
Created March 1, 2016 03:22
sshfs + expect
#!/usr/bin/expect -f
set timeout 20
spawn -ignore HUP sudo /usr/bin/sshfs SSH_LOGIN@SSH_URL:SSH_PATH DIR -p PORT -o allow_other
expect {
"sudo" {
send "SUDO_PASS\r"
exp_continue
}
"worker" {
@ik9999
ik9999 / keyboard_layout.sh
Created January 6, 2016 01:36
Current keyboard layout
#!/bin/bash
layoutsStr="$(setxkbmap -print -v 8 | grep ^layout | awk 'END {print $2}')"
layoutsList=(${layoutsStr//,/ })
layoutIdx="$(xset -q|grep LED| awk '{ print $10 }'|cut -c5)"
echo "${layoutsList[$layoutIdx]}"
@ik9999
ik9999 / kasugano.vim
Created December 30, 2015 23:06
kasugano.vim
" Vim color file - summerfruit_modified2
" Generated by http://bytefluent.com/vivify 2015-12-30
set background=dark
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
@ik9999
ik9999 / Kasugano sakura palette.txt
Created December 30, 2015 21:53
Kasugano sakura palette
{0.239215, 0.239215, 0.239215, 1},
{0.400000, 0.450980, 0.749019, 1},
{0.243137, 0.635294, 0.564705, 1},
{0.690196, 0.917647, 0.850980, 1},
{0.349019, 0.380392, 0.588235, 1},
{0.192156, 0.396078, 0.549019, 1},
{0.509803, 0.572549, 0.698039, 1},
{0.784313, 0.792156, 0.800000, 1},
{0.301960, 0.301960, 0.301960, 1},
{0.537254, 0.603921, 1.000000, 1},
@ik9999
ik9999 / kasugano_color
Created December 30, 2015 00:07
Kasugano color scheme
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
[0] = "#3d3d3d", /* black */
[1] = "#6673bf", /* red */
[2] = "#3ea290", /* green */
[3] = "#b0ead9", /* yellow */
[4] = "#31658c", /* blue */
[5] = "#596196", /* magenta */
set -g default-terminal "screen-256color"
setw -g mode-keys vi
setw -g monitor-activity on
set -g visual-activity on
unbind-key C-b
set-option -g prefix M-a
set-option -sg escape-time 0
set-option -g status-position top
@ik9999
ik9999 / gist:e69c5d70e58c6ed9e06e
Last active December 6, 2015 23:27
Javascript snippets(ES6)
snippet afun "Arrow function" w
(${1}) => {
${2}
}
endsnippet
snippet afune "Arrow function(without paranethesis)" w
${1} => {
${2}
}
@ik9999
ik9999 / gist:0f6990e12906aa326d14
Created November 26, 2015 21:29
MUI color classes
.mui--color-red-50
.mui--bg-color-red-50
@ik9999
ik9999 / jsonstringify.js
Last active November 16, 2015 16:54
javascript - json.stringify with circular references handling and functions.
var cache = [];
var str = JSON.stringify({a: infer.registerFunction}, function(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return;
}
cache.push(value);
}
if (typeof value === 'function') {
return '' + value;
@ik9999
ik9999 / .vimrc
Last active January 24, 2016 21:35
.vimrc
"NeoBundle
if 0 | endif
if has('vim_starting')
if &compatible
set nocompatible
endif
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))