Skip to content

Instantly share code, notes, and snippets.

View jidaikobo-shibata's full-sized avatar

jidaikobo-shibata jidaikobo-shibata

View GitHub Profile
@jidaikobo-shibata
jidaikobo-shibata / is-once-in-a-day.el
Last active July 18, 2016 05:07
Emacs(Elisp): return t once in a day. 1日一回tを返すelispです。
;;; ------------------------------------------------------------
;;; 1日1回のチェック
;; gist-description: Emacs(Elisp): return t once in a day. 1日一回tを返すelispです。
;; gist-id: 33e072cea6aa96a19f58
;; gist-name: is-once-in-a-day.el
;; gist-private: nil
(defun is-once-in-a-day ()
"Is once in a day."
(interactive)
@jidaikobo-shibata
jidaikobo-shibata / defadvice-indent-for-tab-command.el
Last active July 11, 2016 13:34
Emacs(Elisp): To integrate indent style, delete existing whitespaces before indent-for-tab-command. indent-for-tab-commandの前に存在する行頭ホワイトスペースを削除することでインデントスタイルを統一する
;; defadvice-indent-for-tab-command
;; gist-description: Emacs(Elisp): To integrate indent style, delete existing whitespaces before indent-for-tab-command. indent-for-tab-commandの前に存在する行頭ホワイトスペースを削除することでインデントスタイルを統一する
;; gist-id: 604173d11ff376036635fd4811df6abb
;; gist-name: defadvice-indent-for-tab-command.el
;; gist-private: nil
(defadvice indent-for-tab-command (around advise-indent-for-tab-command activate)
"To integrate indent style, delete existing whitespaces before indentation."
(let (beg
end
@jidaikobo-shibata
jidaikobo-shibata / move(region)-to-next(previous)-blank-line.el
Last active July 7, 2016 05:29 — forked from jewel12/gist:2873112
Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。
;;; ------------------------------------------------------------
;;; 次/前の空行
;; gist-description: Emacs(Elisp): forward/backward-paragraphだとparagraph判定がおそらくシンタックステーブル依存になり、字義通りの「次の空行」にならないので、別途用意。
;; gist-id: ad27b19dd3779ccc1ff2
;; gist-name: move(region)-to-next(previous)-blank-line.el
;; gist-private: nil
(defun move-to-previous-blank-line ()
"Go to previous empty lines."
(interactive "^")
@jidaikobo-shibata
jidaikobo-shibata / my-indext-region.el
Last active July 6, 2016 04:12
Emacs(Elisp): indent.elにそのままの機能があったので、そちらに置き換え。
;;; ------------------------------------------------------------
;;; インデント整形
;; gist-description: Emacs(Elisp): indent.elにそのままの機能があったので、そちらに置き換え。
;; gist-id: f941e7f365872920c7f8
;; gist-name: my-indext-region.el
;; gist-private: nil
(global-set-key (kbd "s-}") 'indent-rigidly-right-to-tab-stop)
(global-set-key (kbd "s-]") 'indent-rigidly-right-to-tab-stop)
(global-set-key (kbd "s-{") 'indent-rigidly-left-to-tab-stop)
@jidaikobo-shibata
jidaikobo-shibata / backup.sh
Last active December 9, 2015 12:24
backup shellscript.
#!/bin/sh
# variables
name="username"
dbpass="dbpass"
dbname="dbname"
host="host"
dirname="dirname"
# dump
@jidaikobo-shibata
jidaikobo-shibata / do-somthing-with-peco.sh
Last active November 28, 2015 08:46
shellscripts of MacOS X+bash4+peco
#!/bin/bash
# peco-open-emacs
function peco-open-emacs
{
local files="$( find . -type f | peco )"
files_str=''
for file in $files
do
files_str=$files_str' '$file