Skip to content

Instantly share code, notes, and snippets.

@koyudoon
koyudoon / ibus-switch.py
Created December 9, 2011 19:49
IBus enable/disable
#! /usr/bin/python
# coding: utf-8
import sys
try:
from ibus import bus, inputcontext
except ImportError:
sys.exit(1)
msg_usage = '''usage: ibus-switch.py [on | off | toggle]
@koyudoon
koyudoon / gist:1531263
Created December 29, 2011 02:23
Patch for Taberareloo
// Patch for Taberareloo
// Taberareloo (https://chrome.google.com/webstore/detail/ldcnohnnlpgglecmkldelbmiokgmikno)
// lib/models.js
// Models: GoogleBookmarks
// getUserTags()
getUserTags : function() {
return request('https://www.google.com/bookmarks/mark', {
@koyudoon
koyudoon / Model.GoogleBookmarks.getUserTags.js
Created December 29, 2011 13:32 — forked from serian/Model.GoogleBookmarks.getUserTags.js
tombloo firefox google bookmarks
models['GoogleBookmarks'].getUserTags = function(){
return request('https://www.google.com/bookmarks/mark', {
queryString : {
op : 'add'
}
}).addCallback(function(res){
var doc = convertToHTMLDocument(res.responseText);
var labels = doc.querySelectorAll(
'a[href^="/bookmarks/lookup?q=label:"]:not([href^="/bookmarks/lookup?q=label:%5Enone"])');
var data = [];
@koyudoon
koyudoon / gist:1706314
Created January 30, 2012 19:57
ユーザ定義コマンド「SilSh」:!{cmd} を silent に実行
" ユーザ定義コマンド SilSh
" :!{cmd} を silent に実行
command -nargs=1 -complete=command SilentShell
\ | execute ':silent !'.<q-args> | redraw!
command -nargs=1 -complete=command SilSh
\ | execute ':SilentShell '.<q-args>
#! /usr/bin/python
# coding: utf-8
def HelloWorld():
print 'hello world'
if __name__ == '__main__':
HelloWorld()
@koyudoon
koyudoon / 0_reuse_code.js
Created March 22, 2014 10:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
*** ./lib/grit/index.rb.org 2013-10-22 12:56:48.654590275 +0900
--- ./lib/grit/index.rb 2013-10-23 13:17:49.316559983 +0900
***************
*** 173,179 ****
k = obj.name
k += '/' if (obj.class == Grit::Tree)
tmode = obj.mode.to_i.to_s ## remove zero-padding
! tree_contents[k] = "%s %s\0%s" % [tmode, obj.name, sha]
end if now_tree
@koyudoon
koyudoon / pit-0.3_fix-typo.patch
Created May 12, 2014 03:25
patch for pit-0.3(python) to fix a tiny typo
--- pit.py.org 2014-05-01 05:22:27.000000000 +0900
+++ pit.py 2014-05-12 12:06:55.989623817 +0900
@@ -33,7 +33,7 @@
if result == c:
print 'No Changes'
if name in profile:
- return profile[nane]
+ return profile[name]
return
@koyudoon
koyudoon / gist:f22c8d92ea32fba104e8
Last active August 29, 2015 14:04
今まで適当に git clone していたのを ghq で管理するために、対象プロジェクトを点呼する。
find $HOME -name '.git' -print0 | while read -r -d '' f; do
() {
cd ${f%/*}
local remote="$(git remote)"
[ -z "$remote" ] && continue
pwd
git remote -v
echo
}
#! /bin/sh
# require: [zsh, git, ghq, porg]
HOME_BIN="${HOME_BIN:-$HOME/bin}"
ZSH_COMP_DIR="${ZSH_COMP_DIR:-$HOME/.zsh/vendor/completion}"
GHQ_DIR="${GHQ_DIR:-$(\
eval printf '%s' "$(git config --get 'ghq.root')"\
)}"