This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# https://gist.github.com/hitode909/1239124 | |
# require 'systemu' | |
last = nil | |
loop { | |
current = `pbpaste` | |
if last != current | |
puts current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while : | |
i=`pbpaste` | |
do | |
if [ "$(pbpaste)" != "$i" ];then | |
pbpaste; | |
echo; | |
fi | |
done | |
sleep .5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" 一番上(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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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-` |