Skip to content

Instantly share code, notes, and snippets.

View shishi's full-sized avatar
🏠
Working from home

Shigenobu Nishikawa shishi

🏠
Working from home
View GitHub Profile
@shishi
shishi / gist:3786732
Created September 26, 2012 08:15 — forked from holysugar/gist:3775235
GoogleDrive::Spreadsheet sample
#!/usr/bin/env ruby
# coding: utf-8
require 'google_drive'
require 'highline/import'
require 'active_support/core_ext'
require 'pry'
def ask_authentication
;; Copyright (C) 2007,2008,2009,2010 Hiroki Yagita.
;; ポリシー ----------------------------------------------------------
;; - meadow は捨てました
;; - xemacs は捨てました
;; - なるべくどこでも動くようにしたい
;; - 初期化スクリプトは ~/.emacs.d/init.el にしています
;; - ~/.emacs.d/ の下に分離スクリプトやデータを置くことがあります(それ以外の場所に置かない)
@shishi
shishi / .vimrc
Created September 1, 2012 05:05
vimrc
set encoding=utf-8
set fileencodings=utf-8,cp932,euc-jp,iso-2022-jp-3,euc-jisx0213,guess,ucs-bom,ucs-2le,ucs-2
"オリジナルの順はguess, ucs-bom, ucs-2le,ucs-2, iso-2022-jp-3,utf-8, euc-jisx0213, euc-jp
scriptencoding utf-8
"autocmd初期化
augroup MyAutoCmd
autocmd!
augroup END
@shishi
shishi / rst2html.py
Created July 2, 2012 18:43
make enable rst2html to deal valid code-block directive
from sphinx.directives.other import *
from sphinx.directives.code import *
@shishi
shishi / install_sphinx.sh
Created July 2, 2012 18:38
install python-sphinx
sudo apt-get install python-sphinx
@shishi
shishi / delete_remote_branch.sh
Created June 25, 2012 12:25 — forked from fujimura/delete_remote_branch.sh
Delete remote brranches except master
git branch -a | grep origin | cut -d / -f 3 | grep -v master | \
ruby -e "STDIN.to_a.tap(&:shift).map(&:chomp).each {|s| p %|git push origin #{s}| }"
# replace `p` with `system` to run actual command
@shishi
shishi / nabeatsu.rb
Created May 23, 2012 16:45
nabeatsu for restrict condition sentenses
class Nabeatsu
def say
content = { 'true' => 'hoge', 'false' => number.to_s }
true_or_false = (number % 3 == 0) || !!(number.to_s =~ /3/)
p content[true_or_false.to_s]
end
end
@shishi
shishi / auto-complete-config.el
Created May 3, 2012 20:57
fix cooprate with yasnippet
(defun ac-yasnippet-candidates ()
(with-no-warnings
(if (>= (string-to-number yas/version) 0.7)
(apply 'append (mapcar 'ac-yasnippet-candidate-1 (yas/get-snippet-tables)))
(if (fboundp 'yas/get-snippet-tables)
;; >0.6.0
(apply 'append (mapcar 'ac-yasnippet-candidate-1 (yas/get-snippet-tables major-mode)))
(let ((table
(if (fboundp 'yas/snippet-table)
;; <0.6.0
#
# Show branch name in Zsh's right prompt
#
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null
setopt prompt_subst
setopt re_match_pcre
function rprompt-git-current-branch {
@shishi
shishi / el-get.el
Created April 11, 2012 07:46
a part of my el-get setting
;; el-get
(setq el-get-dir "~/.emacs.d/elisp/el-get/")
;; ;; So the idea is that you copy/paste this code into your *scratch* buffer,
;; ;; hit C-j, and you have a working el-get.
;; ;; (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
;; (unless (require 'el-get nil t)
;; (url-retrieve
;; "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
;; (lambda (s)