Skip to content

Instantly share code, notes, and snippets.

@anekos
anekos / ramen.sh
Created January 3, 2016 11:39
ニコニコラーメンタイマースクリプト
#!/bin/bash
set -e
function usage () {
echo 'ramen [-q $query] [-m $minutes] [-from $from] [-t tolerance]
default values:
query = ラーメンタイマー
minutes = 3
@anekos
anekos / .vimrc
Last active September 30, 2015 01:58
unite-grep で使うコマンドをランダムで選ぶ
function! Rand(n)
" http://vim-jp.org/vim-users-jp/2009/11/05/Hack-98.html
let l:match_end = matchend(reltimestr(reltime()), '\d\+\.') + 1
return reltimestr(reltime())[l:match_end : ] % (a:n + 1)
endfunction
let s:unite_grep_settings = [
\ {
@anekos
anekos / play-chaos
Last active August 29, 2015 14:21
忙しい人向けの音楽プレイヤー
#!/bin/bash
for file in "$@"
do
mpg123 -loop=-1 -- "$file" &
done
@anekos
anekos / steel-hash.rb
Created April 27, 2015 12:20
Steel Hash
class SteelHash
def initialize (hash)
hash.each do
|k, v|
define_singleton_method(k) { v }
end
end
end
set runtimepath+=~/.vim-temp/bundle/incsearch.vim
nmap / <Plug>(incsearch-forward)
@anekos
anekos / mouse.sh
Created March 28, 2015 16:23
マウス無効化するスクリプト
#!/bin/sh
case "$1" in
on)
value=1
;;
off)
value=0
;;
*)
@anekos
anekos / hatebu-ancient-date.js
Created November 2, 2014 00:30
はてブの最古のコメント日付を表示
command! data :echo let(bs=JSON.parse(util.httpGet('http://b.hatena.ne.jp/entry/json/?url=' + encodeURIComponent(buffer.URL)).responseText).bookmarks)(bs.map(function(it)it.timestamp).sort())[0]
@anekos
anekos / feedeen.com.js
Last active August 29, 2015 14:07
feedeen.com for vimperator
(function () {
let A = Array.slice;
const selectors = {
selectedEntry: '.fd_focus',
currentFeedTitle: '.fd_current_feed_title',
feeds: '.fd_feed',
feedTitle: '.fd_feed_title',
@anekos
anekos / feedly.com.js
Created October 8, 2014 11:42
feedly.com 用の vimperator プラギン, readitlater のプラグインあると良い
(function () {
const api = {
matchingUrls: new RegExp('^https?://feedly.com/'),
get doc () content.document,
@anekos
anekos / .compton.conf
Created September 24, 2014 22:34
compton の設定
# Shadow
shadow = false;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
# shadow-opacity = 0.7;
# shadow-red = 1.0;