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
;;; -*- Mode: Lisp; Package: editor -*- | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; .xyzzy ;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
;;; -*- Mode: Lisp; Package: editor -*- | |
;;; | |
;;; discrete.l | |
;;; | |
(provide "discrete") | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;@@@ util | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
;; in discrete.l | |
isearch中に | |
C-w 選択範囲を1語前方(右)へ拡張 | |
C-h 選択範囲を1語後方(左)へ拡張 | |
C-y 選択範囲を行末まで拡張 | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;@@@ insert-horizontal-line | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
# | |
# utils | |
# | |
def usage(exit_code=0): | |
print USAGE_MSG | |
sys.exit(exit_code) | |
def error_exit(msg='error occurred. quit.'): | |
print msg | |
sys.exit() |
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
# -*- coding: utf-8 -*- | |
""" | |
PHPのvar_dump的なもの | |
""" | |
from pprint import pprint | |
import types | |
def var_dump(obj, stream=None): | |
pprint(dump(obj), stream) |
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
# unescape_html_ent.py | |
# | |
# thx: | |
# http://effbot.org/zone/re-sub.htm#unescape-html | |
import re, htmlentitydefs | |
## | |
# Removes HTML or XML character references and entities from a text string. | |
# |
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 caller(f): | |
return f(3) | |
>>> caller(lambda x: x*2) | |
6 | |
>>> def qu(n): | |
return n*4 | |
>>> caller(qu) | |
12 |
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
:: dnd_rm_svn.bat | |
:: | |
:: ドラッグアンドドロップしたフォルダ内の .svnフォルダを再帰的に削除する | |
:: | |
:: 使い方: フォルダをこのバッチファイルのアイコンにドラッグアンドドロップする | |
:: ローカルPC以外では動きません | |
@echo off | |
setlocal |
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
(defun iota (max &optional min) | |
"minからmaxまでの整数をリストで返す。min省略時は1から。" | |
(unless min (setq min 1)) | |
(if (< max min) nil | |
(cons min (iota max (1+ min))))) | |
(defun multiple-p (n of) | |
"nがofの倍数かどうかを返す。" | |
(if (= (% n of) 0) t 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
(defvar ol-mark-fringe nil) | |
(defun fr () | |
(interactive) | |
(let ((s (make-string 1 ?x))) | |
(when ol-mark-fringe (delete-overlay ol-mark-fringe)) | |
(setq ol-mark-fringe (make-overlay (point) (1+ (point)))) | |
(put-text-property 0 1 'display '(left-fringe right-triangle) s) | |
(overlay-put ol-mark-fringe 'before-string s))) |