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/sh | |
# variables | |
name="username" | |
dbpass="dbpass" | |
dbname="dbname" | |
host="host" | |
dirname="dirname" | |
# dump |
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 | |
# 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 |
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
;;; ------------------------------------------------------------ | |
;;; 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) |
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
;;; ------------------------------------------------------------ | |
;;; 選択範囲を1行にする。最初のインデントは残す。 | |
;; gist-description: Emacs(Elisp): Join multi lines to one. 選択範囲を1行にまとめます。 | |
;; gist-id: ee6b2f8ef659ed58605d | |
;; gist-name: join-multi-lines-to-one.el | |
;; gist-private: nil | |
(defun join-multi-lines-to-one () | |
"Join multi lines." | |
(interactive) |
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
;;; ------------------------------------------------------------ | |
;; gist-description: Emacs(Elisp): create or update gist by using yagist. yagistでregionのgistをupdateする。 | |
;; gist-id: a20cd2d106edba225115 | |
;; gist-name: yagist-region-create-or-update.el | |
;; gist-private: nil | |
(require 'yagist) | |
(defun yagist-region-create-or-update (beg end) | |
"Post the current region as a create or update at gist.github.com. |
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
;;; ------------------------------------------------------------ | |
;;; 全角英数字を半角英数字に、半角カナを全角に、UTF-8の濁点分離を直す | |
;; http://d.hatena.ne.jp/nakamura001/20120529/1338305696 | |
;; http://www.sakito.com/2010/05/mac-os-x-normalization.html | |
;; gist-description: Emacs(Elisp): 全角英数字を半角英数字に、半角カナを全角に、UTF-8の濁点分離を直す。 | |
;; gist-id: 08a752b04107dbc50ef5 | |
;; gist-name: normalize-chars.el | |
;; gist-private: nil | |
(require 'ucs-normalize) |
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
;;; ------------------------------------------------------------ | |
;;; 選択範囲を計算してバッファに出力 | |
;; gist-description: Emacs(Elisp): calculate region and insert. 選択範囲の数式を計算して、次の行にinsertします。数字が羅列されている場合は、加算します。数字や式と自然な文章が混在している場合は、数式のみを計算します。 | |
;; gist-id: b967d6a7441f85aa541d | |
;; gist-name: calculate-region-and-insert.el | |
;; gist-private: nil | |
(defun add-number-grouping (number &optional separator) | |
"Add commas to NUMBER and return it as a string. | |
Optional SEPARATOR is the string to use to separate groups. |
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
;;; 行/選択範囲の複製 (cmd+d) | |
;; gist-description: Emacs(Elisp): duplicate region or line. if same command repeated, then duplicate sate strings. 選択範囲がある場合は選択範囲を、選択範囲がない場合は、行を複製します。繰り返した場合、同じ文字列を複製し続けます。 | |
;; gist-id: 297fe973cde66b384fa1 | |
;; gist-name: duplicate-region-or-line.el | |
;; gist-private: nil | |
(defvar previous-duplicate-region-or-line nil) | |
(defvar previous-duplicate-region-or-line-was-line nil) | |
(defun duplicate-region-or-line () | |
"Duplicate region or line." |
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
;; move-current-tab-to-top | |
;; gist-description: Emacs(Elisp): move current tab (buffer) to top at tabbar-mode. tabbarで選択中のタブ(バッファ)を左端に移動します。 | |
;; gist-id: 54dab2fc5f2e278833f5 | |
;; gist-name: move-current-tab-to-top.el | |
;; gist-private: nil | |
(defun move-current-tab-to-top () | |
"Move current tab to top." | |
(interactive) | |
(let* ((bufset (tabbar-current-tabset t)) |
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
;;; ------------------------------------------------------------ | |
;;; インデント整形 | |
;; 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) |
OlderNewer