Skip to content

Instantly share code, notes, and snippets.

View saihoooooooo's full-sized avatar
♨️
noop

shinya.saiho saihoooooooo

♨️
noop
View GitHub Profile
@saihoooooooo
saihoooooooo / gethighlight.vim
Last active August 29, 2015 14:03
ハイライト構文を取得
function! s:GetHighlight(group_name)
redir => hl
silent execute 'highlight ' . a:group_name
redir END
return substitute(substitute(hl, '[\r\n]', '', 'g'), 'xxx', '', '')
endfunction
function s:hoge()
let old = s:GetHighlight('Cursor')
var list = ['a', 'b', 'c', 'd'];
var cur;
function plus() {
cur = (cur + 1) % list.length
}
function minus() {
cur = (cur - 1 + list.length) % list.length
}
@saihoooooooo
saihoooooooo / faindo.vim
Last active August 29, 2015 13:56
faindo
there are multiple target in current line
there are multiple targets in current line
To the first.
Move to the first position of candidates.
Decide the position at the time of input.
@saihoooooooo
saihoooooooo / merge-git.coffee
Last active August 15, 2018 01:59
git merge & push in hubot.
# Description:
# Merge git branch.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@saihoooooooo
saihoooooooo / montile.sh
Created February 8, 2014 17:48
make tile-image(50px * 50px) from the same image using ImageMagick.
#!/bin/sh
if [ $# -ne 3 ]
then
exit 1
fi
base=$1
x=$2
y=$3
@saihoooooooo
saihoooooooo / dice.bash
Created January 18, 2014 01:28
random number generator. (bash)
#!/bin/bash
awk 'BEGIN {srand(); print int(6 * rand()) + 1}'
@saihoooooooo
saihoooooooo / substitute.txt
Last active January 2, 2016 12:29
Make SQL from id and id. (use quickrun)
3,$s/\(\d\+\),\(\d\+\)/UPDATE m_hoge SET id = \2 WHERE id = \1;/
1,11
2,12
3,13
4,14
5,15
6,16
7,17
8,18
@saihoooooooo
saihoooooooo / Vagrantfile
Last active January 1, 2016 10:29
test recipe for vagrant.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@saihoooooooo
saihoooooooo / git-setting.bash
Last active December 27, 2015 10:59
Git setting for bash.
#!/bin/bash
curl -oL https://raw.github.com/git/git/master/contrib/completion/git-completion.bash ~/git-completion.bash
curl -oL https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh ~/git-prompt.sh
cat >> ~/.bashrc << \EOF
# Completion and display of git branch
source ~/git-completion.bash
source ~/git-prompt.sh
@saihoooooooo
saihoooooooo / weblio-searchbar-killer.js
Created November 5, 2013 05:25
weblio辞書の検索バーを殺す
// ==UserScript==
// @name weblio-searchbar-killer
// @namespace weblio-searchbar-killer
// @include http://ejje.weblio.jp/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @version 1
// @grant none
// ==/UserScript==
$(function () {