Skip to content

Instantly share code, notes, and snippets.

function! s:update_cbuffer_growl()
ruby << EOC
line = VIM::Buffer.current.line
system("growlnotify -a MacVim -m '#{line}'")
EOC
endfunction
function! s:update_cbuffer()
augroup update-cbuffer
autocmd!
#! /usr/bin/env ruby
# https://gist.github.com/hitode909/1239124
# require 'systemu'
last = nil
loop {
current = `pbpaste`
if last != current
puts current
#!/bin/bash
while :
i=`pbpaste`
do
if [ "$(pbpaste)" != "$i" ];then
pbpaste;
echo;
fi
done
sleep .5
"" 一番上(3行目)のツイートを通知する
"" https://gist.github.com/rhysd/4201877
"" NeoBundle 'supermomonga/shiraseru.vim'
" 自動更新間隔(秒)
let s:tweetvim_update_interval_seconds_growl = 4
let s:tweetvim_timestamp_growl = reltime()[0]
function! s:tweetvim_autoupdate_growl()
" GistPaste
" Gistへの投稿後、「:GistPaste」で投稿のHTMLタグを貼り付け
" http://nukino.github.com/blog/2012/01/16/gist_vim/
func! s:paste_gist_tag()
let mx = 'http[s]\?://gist.github.com/\([0-9]\+\)'
" +または"レジスタの中身を検索する
let regs = [@+,@"]
for r in regs
let mlist = matchlist(r, mx)
if ( len(mlist) > 2 )
# google_translate [-j, -e]
# $ google_translate -e power line
function google_translate() {
local str opt arg
str=`pbpaste` # clipboard
arg=`echo ${@:2} | sed -e 's/ */+/g'` # argument
en_jp="?hl=ja&sl=en&tl=ja&ie=UTF-8&oe=UTF-8" # url
case "$1" in
## zsh/growl integration: any command that takes longer than 5 seconds
## will trigger a growl notification when it completes.
## https://github.com/patbenatar/dotfiles/blob/master/zsh/growl.zsh
if growlnotify -h &>/dev/null; then
preexec() {
zsh_growl_cmd=$1
zsh_growl_time=`date +%s`
}
@syui
syui / qiita-unfollow.sh
Created November 17, 2015 08:48
qiita-unfollow
#!/usr/local/bin/zsh
user=$USER
page=`curl -sL http://qiita.com/${user}/following_users | grep data-pjax | tail -n 1 | cut -d "?" -f 2 | cut -d '"' -f 1 | cut -d = -f 2`
#user=syui
#page=12
following=$(for (( i=1;i<=${page};i++ ))
do
html=`curl -sL "http://qiita.com/${user}/following_users?page=${i}" | grep 'span itemprop="name"' | tr '>' '\n' | grep -A1 'itemprop="name"' |cut -d '<' -f -1`
@syui
syui / comic-walker.com-screenshot.sh
Created November 17, 2015 08:47
comic-walker.com-screenshot.
#!/usr/local/bin/zsh
case $1 in
"") pg=16 ;;
*) pg=$1 ;;
esac
tl=`osascript -e 'tell application "Google Chrome" to get NAME of active tab of first window' | cut -d ' ' -f -1`
ul=`osascript -e 'tell application "Google Chrome" to get URL of active tab of first window'`
ul=`echo ${ul:t} | cut -d = -f 4-`
# curl -O https://gist.githubusercontent.com/richmikan/3251311/raw/290c70b9a45b5eb66036b83de79bfe6bb0b3b054/parsrx.sh
function searchClipBoard() {
cclip=`plutil -convert xml1 ~/Library/Application\ Support/ClipMenu/clips.data -o - | parsrx.sh | grep '/plist/dict/array/string ' | sed '1,2d' | sed 's/\/plist\/dict\/array\/string//g' | peco`
echo $cclip | pbcopy
}
zle -N searchClipBoard
bindkey '^x^p' searchClipBoard