- launch terminal, and type
bash -i . ./shellsclisp.sh(.known assource)- interactive lisp shell!!!
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
| Select all and delete (actually move to buffer) | |
| :%d | |
| Select all and copy to buffer | |
| :%y | |
| Use p to paste the buffer. |
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
| * common-lisp: format: | |
| ~a aesthetic | |
| ~s readで読める形式 | |
| ~:a nil → () で出力 | |
| ~% 改行 | |
| ~& 先頭でないときに改行 | |
| ~5% 5個改行 | |
| ~~ ~を出力 | |
| ~5~ 5個出力 | |
| ~c 文字 |
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
| -- Generate a link text in org-mode style and copy it to clipboard | |
| tell application "Safari" | |
| set theTitle to do JavaScript "document.title" in front document | |
| set theURL to URL of front document | |
| end tell | |
| set the clipboard to "[[" & theURL & "][" & theTitle & "]]" |
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
| (when (and (>= emacs-major-version 24) | |
| (eq window-system 'ns)) | |
| ;; フォントセットを作る | |
| (let* ((fontset-name "myfonts") ; フォントセットの名前 | |
| (size 14) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...] | |
| (asciifont "Menlo") ; ASCIIフォント | |
| (jpfont "Hiragino Maru Gothic ProN") ; 日本語フォント | |
| (font (format "%s-%d:weight=normal:slant=normal" asciifont size)) | |
| (fontspec (font-spec :family asciifont)) | |
| (jp-fontspec (font-spec :family jpfont)) |
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
| ;;; Monadic Operators | |
| ;;; List Monad | |
| (define (mappend fn . lists) | |
| (apply append (apply map fn lists))) | |
| (define (bind monad . funcs) | |
| (fold mappend monad funcs)) | |
| (define unit list) |
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
| ;; ucs-normalize-NFC-region で濁点分離を直す | |
| ;; M-x ucs-normalize-NFC-buffer または "C-x RET u" で、 | |
| ;; バッファ全体の濁点分離を直します。 | |
| ;; 参考: | |
| ;; http://d.hatena.ne.jp/nakamura001/20120529/1338305696 | |
| ;; http://www.sakito.com/2010/05/mac-os-x-normalization.html | |
| (require 'ucs-normalize) | |
| (prefer-coding-system 'utf-8-hfs) | |
| (setq file-name-coding-system 'utf-8-hfs) |
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
| /* | |
| @utatakiyoshi: 友達がSkypeで「0~9を1回ずつ使い,?????/?????=1/9となるように?を埋めよ」って算数パズルを出してきたからC++でサクッと書いてドヤ顔してやった | |
| ちなみにこうなった | |
| result: 6381 57429 | |
| result: 6471 58239 | |
| result: 8361 75249 | |
| result: 10638 95742 | |
| result: 10647 95823 | |
| result: 10836 97524 |
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
| ;;; 行中で最初に現れた括弧と対応する閉じ括弧を(薄く)ハイライトする | |
| ;;; (jit-lock-register #'dehighlight-paren) | |
| ;;; で動くつもり | |
| (defvar paren-face 'paren-face) | |
| (make-face 'paren-face) | |
| (set-face-foreground 'paren-face "grey90") | |
| (defun dehighlight-paren-1 (pos) | |
| (add-text-properties pos (1+ pos) |
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
| (load-library "cl-extra") | |
| (defun my-get-face-attributes (face) | |
| (reverse | |
| (mapcan '(lambda (a) | |
| (let ((v (face-attribute face a))) | |
| (if (not (or (eq a :inherit) (eq v 'unspecified))) | |
| (list v a)))) | |
| (mapcar 'car face-attribute-name-alist)))) |