This file contains hidden or 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
<html> | |
<head> | |
<title>Writing HTML with S-expression</title> | |
</head> | |
<body> | |
<div id="main"> | |
<h1>Stag</h1> | |
<ul class="navi"> | |
<li> | |
<a href="/menu1">menu 1</a> |
This file contains hidden or 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
<html> | |
<head> | |
<title>Writing HTML with S-expression</title> | |
</head> | |
<body> | |
(div :id "main" | |
(h1 "Stag") | |
(ul :class "navi" | |
(li (a :href "/menu1" "menu 1")) | |
(li (a :href "/menu2" "menu 2")) |
This file contains hidden or 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
;; (require 'zencoding-builder) | |
;; (define-key zencoding-mode-keymap (kbd "M-RET") 'zencoding-builder) | |
(defvar zencoding-builder-start-point nil) | |
(make-variable-buffer-local 'zencoding-builder-start-point) | |
(defvar zencoding-builder-end-point nil) | |
(make-variable-buffer-local 'zencoding-builder-end-point) | |
(defvar zencoding-builder-window nil) |
This file contains hidden or 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
;; cucumber | |
;; http://github.com/michaelklishin/cucumber.el | |
;; 日本語でも色つける | |
(require 'feature-mode) | |
(defconst feature-mode-ja-keywords | |
'("フィーチャ" "機能" "背景" "シナリオ" "シナリオアウトライン" | |
"シナリオテンプレート" "テンプレ" "シナリオテンプレ" | |
"例" "サンプル" "前提" "もし" "ならば" "かつ" "しかし" "但し" "ただし")) | |
(defconst feature-font-lock-ja-keywords |
This file contains hidden or 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
(defadvice delete-backward-char | |
(around stop-when-beginning-of-line (n &optional killflag) activate) | |
"前の行まで削除しない" | |
(unless (equal (point) (point-at-bol)) | |
ad-do-it)) | |
(defadvice delete-char | |
(around stop-when-end-of-line (n &optional killflag) activate) | |
"次の行まで削除しない" | |
(unless (equal (point) (point-at-eol)) |
This file contains hidden or 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
(defvar killed-buffers '()) | |
(defun add-killed-buffer-list () | |
(let ((b (buffer-file-name))) | |
(unless (null b) | |
(add-to-list 'killed-buffers b)))) | |
(add-hook 'kill-buffer-hook 'add-killed-buffer-list) | |
(defun rebirth-of-buffer () | |
(interactive) |
This file contains hidden or 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
(defadvice find-file | |
(before find-file-create-intermediate-directories (filename &optional wildcards)) | |
"中間ディレクトリが存在しない時は作成する" | |
(let ((dir (file-name-directory filename))) | |
(if (and dir | |
(not (file-exists-p dir))) | |
(make-directory dir t)))) |
This file contains hidden or 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
def String.random(size, option={}) | |
option = { | |
:capital => false, | |
:exclude => [] | |
}.merge(option) | |
alphanumerics = ('a'..'z').to_a + ('0'..'9').to_a | |
alphanumerics += ('A'..'Z').to_a if option[:capital] | |
alphanumerics -= option[:exclude].to_a |
This file contains hidden or 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
;; js2-mode | |
(when (load "js2") | |
(setq js2-cleanup-whitespace nil | |
js2-mirror-mode nil | |
js2-bounce-indent-flag nil) | |
(defun indent-and-back-to-indentation () | |
(interactive) | |
(indent-for-tab-command) | |
(let ((point-of-indentation |
This file contains hidden or 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
;; js2-mode | |
(autoload 'js2-mode "js2" nil t) | |
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
(add-hook 'js2-mode-hook | |
'(lambda () | |
(setq js2-cleanup-whitespace nil | |
js2-mirror-mode nil | |
js2-bounce-indent-flag nil) | |
NewerOlder