Commits

R Primus  committed d801722

add txt files from lri.me

  • Participants
  • Parent commits 463ecc3

Comments (0)

Files changed (7)

File osx/lri.me/emacsbasic.txt

+#help
+C-h b shows a list of keybindings
+C-h C-h shows a list of help commands
+C-h f is describe-function and C-h v is describe-variable
+C-x 4 C-h shows bindings that start with C-x 4
+C-h r opens the info node for the Emacs manual
+
+#apropos
+C-h a (apropos-command) searches for interactive functions
+C-u C-h a searches for interactive and non-interactive functions
+C-h a transpose RET shows commands whose name contains transpose
+C-u C-h a regexp RET shows all functions whose name contains regexp
+M-x apropos-variable RET ruby RET lists variables whose name contains ruby
+C-h d searches in the docstrings of functions and variables
+M-x info-apropos RET grep RET shows matches for grep in info indexes
+
+#info
+space scrolls down or selects the next node in a sequence
+backspace scrolls up or selects the previous node in a sequence
+n selects the next node, p selects the previous node, and u goes up
+] selects the next node in a sequence
+C-h i d m emacs RET or C-h i g(emacs) RET goes to the emacs node
+m selects a menu item
+d goes to the directory node that is shown when opening a new info buffer
+tab and C-M-i select menu items and cross-references
+mxyz selects the first menu item that starts with xyz
+fxyz follows the first cross-reference that starts with xyz
+5 selects the fifth menu item
+l goes to the last visited node and r goes back after l
+L shows a menu of visited nodes
+ixyz searches for xyz in the index and opens the first result
+, opens the next result after i
+Ixyz displays a list of nodes that contain xyz
+> goes to the final node
+C-h i d m emacs <RET> i TOPIC <RET> searches for TOPIC in the Emacs info index
+i searches in the index and s searches for in the full text of an info page
+
+#dired
+m marks a file, u unmarks a file, and U unmarks all files
+%m marks files whose name matches a regular expression
+%m \.html$ RET marks HTML files
+C copies files and R renames files
+d flags files for deletion and x deletes flagged files
+D deletes files immediately
+M changes mode, G changes group, O changes owner, and T changes timestamps
+^ goes to a parent directory
++ creates a new directory
+g refreshes a directory listing
+! runs a shell command on the selected files
+you can use M-! to run shell commands in the current directory
+Z compresses files with gzip or uncompresses gz or tar files
+s toggles between sorting by name and date
+a opens a directory in the current buffer
+you can rename files by pressing C-x C-q and then editing the filenames
+
+#package
+if package-install doesn't find a package, try to run package-refresh-contents
+
+#customize
+C-x C-s applies and saves changes and C-c C-c applies changes
+M-x custom-reset-standard removes all customizations
+M-x customize-changed RET 24.3 RET customizes settings changed in Emacs 24.3
+
+#nxml-mode
+C-c C-i inserts > and a closing tag on the same line
+C-c C-b inserts > and a closing tag on a different line
+C-c / (nxml-finish-element) inserts a closing tag
+C-c C-v (rng-validate-mode) toggles validation
+C-M-n is nxml-forward-element
+C-c C-u IDEOGRAPHIC SPACE RET inserts &#x3000;
+
+#sgml-mode
+C-c C-v (browse-url-of-buffer) opens the current file in a browser
+C-c C-f is sgml-skip-tag-forward and C-c C-d is sgml-delete-tag
+
+#markdown-mode
+C-c C-n selects the next heading
+C-c C-f selects the next same level heading
+C-c C-u goes up
+<M-return> inserts a new list item below
+C-c C-s C-b is markdown-blockquote-region
+C-c C-c n is markdown-cleanup-list-numbers
+
+#shell-mode
+C-c C-x runs a script
+M-a is sh-beginning-of-command and M-e is sh-end-of-command
+C-M-x executes the region
+
+#comint
+C-c C-c is comint-interrupt-subjob and C-c C-\ is comint-quit-subjob
+
+#ido
+C-k deletes a file in ido-find-file and a kills a buffer in ido-switch-buffer
+ido uses regex matching so use .* instead of *
+C-e edits the input string
+C-p toggles between prefix matching
+C-t toggles regex matching
+and C-c toggles case sensitivity
+C-d opens a directory in dired in ido-find-file
+M-p goes to the previous working directory in ido-find-file
+M-m creates a new directory in ido-find-file
+
+#themes
+M-x customize-create-theme creates a theme
+M-x custom-theme-visit-theme edits a theme created with customize-create-theme
+
+#smex
+C-h f runs describe-function
+M-. jumps to a definiton
+smex-show-unbound-commands shows frequently used commands with no keybindings
+smex-major-mode-commands only shows commands relevant to the active major mode
+
+#OS X
+(setq ns-command-modifier 'meta) changes command to meta
+(setq ns-right-control-modifier 'super) changes the right control to super
+(setq ns-option-modifier nil) allows using option to insert non-ASCII characters
+(setq-default ns-use-native-fullscreen nil) uses custom full screen windows
+many OS X-specific features are defined in ns-win.el
+doc-view-mode and proced don't work in OS X out of the box
+
+#Emacs 24.4
+electric-indent-mode is enabled by default
+C-x <tab> activates a transient mode where <left> and <right> change indentation
+tab-stop-list is nil by default which means a tab stop every tab-width columns
+uniquify is enabled by default
+? describes prefix bindings
+there is a new toggle-frame-fullscreen command that is bound to F11
+there is a new toggle-frame-maximized command that is bound to M-<f1>0
+the new focus-out-hook hook is run when a frame loses focus
+the new focus-in-hook hook is run when a frame gets focus
+C-x SPC (rectangle-mark-mode) creates a rectangular region
+files like .ido.last and .emacs-places are saved to ~/.emacs.d/
+the positions of frames and windows are saved when desktop-save-mode is enabled
+M-s . searches for the next occurrence of a symbol near point
+iswitchb was made obsolete in favor of icomplete-mode
+longlines.el was made obsolete in favor of visual-line-mode
+eww is a new web browser package
+there is a new prefer-utf-8 coding system
+there is a new string-suffix-p function
+support for variadic comparisons like (= a b c) was added
+(superword-mode 1) makes for example x_y and x-y be treated as single words
+there is a new delete-duplicate-lines command
+
+#Emacs 23
+transient-mark-mode is enabled by default
+shift-arrows select text unless shift-select-mode is set to nil
+line-move moves the point by visual lines unless line-move-visual is nil
+visual-line-mode wraps lines at word boundaries
+linum-mode adds line numbers
+C-x b, M-x, C-h f, and ucs-insert support wildcards
+whitespace-mode visualizes whitespace characters
+whitespace-newline-mode visualizes newlines
+wdired-change-to-wdired-mode is bound to C-x C-q
+characters are encoded as utf-8-unix instead of mule-utf-8-unix
+ucs-insert is bound to C-x 8 RET
+proced is a mode like dired for managing processes
+ruby-mode is included by default
+doc-view-mode is a mode for viewing pdf, ps, and dvi files
+epa (EasyPG Assistant) is an interface to gpg
+(setq delete-by-moving-to-trash t) enables using the trash folder of the OS
+
+#unsorted interactive
+M-@ is mark-word, C-M-@ is mark-sexp, and C-M-h is mark-defun
+C-c C-b is help-go-back in a help buffer
+C-x C-e is eval-last-sexp
+C-h C-n (view-emacs-news) shows Emacs version history
+C-u C-x C-e inserts the result of the last sexp
+winner-mode makes C-c <left> undo changes in window configuration
+M-! is shell-command and M-| is shell-command-on-region
+C-u M-| replaces the region
+M-z is zap-to-char
+M-z " deletes up to the next " and M-- M-z " deletes up to the previous "
+C-M-k is kill-sexp
+M-k is kill-sentence and C-x DEL is backward-kill-sentence
+M-x ffap RET RET opens a URL at point in a browser
+C-M-f (forward-sexp) goes to a closing brace
+C-M-% <\([^>]+\)> RET <\,(downcase \1)> RET makes XML tags lowercase
+M-s h l is highlight-lines-matching-regexp
+M-s h l .\{81\} RET highlights long lines
+C-x n n (narrow-to-region) shows only the lines in the region
+C-x n w (widen) undoes narrowing
+C-x f is set-fill-column
+C-M-\ is indent-region
+C-x h C-M-\ reindents a buffer
+C-r views a buffer and d shows changes to a buffer after C-x C-c
+C-s C-w searches for the word after the point
+C-s C-M-y C-M-y searches for two characters after the point
+you can use C-x r t (string-rectangle) to insert text on multiple lines
+C-M-% [0-9]+ RET \,(1+ \#&) RET adds 1 to each number
+\#& is replaced with the matched string interpreted as a number
+M-x align-regexp RET = RET adds spaces before equals signs
+you can open a .info file with C-u C-h i
+M-x find-function RET global-set-key RET finds the definition of global-set-key
+M-x find-function RET RET finds the definition of the function near the point
+you can use C-h l to see escape sequences for previously pressed keys
+C-h F is Info-goto-emacs-command-node
+C-h F hippie-expand RET opens the info node for hippie-expand
+C-x v + is vc-update and C-x v = is vc-diff
+M-x auto-revert-mode enables automatically reverting the current buffer
+M-x flush-lines RET ^; RET deletes lines that start with ;
+M-x keep-lines RET ^foo RET deletes lines that don't start with foo
+M-x flyspell-prog-mode checks for spelling in comments and strings
+C-x C-n sets a goal column and C-u C-x C-n unsets a goal column
+M-m (back-to-indentation) moves the point to the first non-whitespace character
+C-x RET C-\ is set-input-method
+C-x RET C-\ TeX RET \alpha inserts an alpha character
+M-x delete-trailing-whitespace or C-x RET f unix converts CRLF line endings to LF
+C-u C-u C-x } makes a window 16 characters wider
+C-x 5 0 is delete-frame
+C-x 5 1 is delete-other-frames
+C-x 5 2 is make-frame-command
+ido-menu jumps to a definition in the current file
+C-S-backspace is kill-whole-line
+C-x r s 1 saves text to register 1 and C-x r i s inserts the text in register 1
+C-x r <SPC> 1 saves the point in register 1 and C-x r j 1 jumps to register 1
+C-x r w 1 saves window configuration and C-x r j 1 restores window configuration
+M-x view-register RET 1 shows the contents of the register 1
+C-x r s is copy-to-register
+C-x r i is insert-register
+C-x r <SPC> is point-to-register
+C-x r j is jump-to-register
+C-x r w is window-configuration-to-register
+C-x r f is frame-comfiguration-to-register
+C-x r r is copy-rectangle-to-register
+C-x * * opens calc
+C-x $ is set-selective-display
+M-6 C-x $ hides lines indented by 6 or more columns
+M-1 C-x $ only shows unindented lines
+pressing C-x $ again turns off selective display
+M-x toggle-truncate-lines toggles between folding and truncating long lines
+C-x 4 0 is kill-buffer-and-window
+C-x 4 c is clone-indirect-buffer-other-window
+M-r is previous-matching-history-element in minibuffer-local-map
+M-x list-command-history shows a list of commands typed in the minibuffer
+C-x <ESC> <ESC> (repeat-complex-command) executes commands from command history
+C-h . (display-local-help) shows tooltip text
+C-h L utf-8 describes the utf-8 language environment
+C-h d searches in the docstrings of built-in symbols
+C-u C-h d searches in all currently defined docstrings
+C-h p (finder-by-keyword) shows a list of ELPA packages grouped under categories
+C-h P yasnippet RET opens a buffer that describes yasnippet
+C-h e (view-echo-area-messages) opens the *Messages* buffer
+you can use C-<SPC> C-<SPC> to mark a position to return to later
+C-u C-<SPC> returns to a position marked with C-<SPC> C-<SPC>
+C-h v kill-ring RET shows the contents of the kill ring
+M-x append-to-buffer appends text to a buffer
+M-x copy-to-buffer replaces the contents of a buffer
+C-x r y is yank-rectangle
+C-x r M-w is copy-rectangle-as-kill
+C-x r o (open-rectangle) inserts a rectangle of spaces
+C-x r c (clear-rectangle) replaces all characters in the rectangle with spaces
+(set-register ?z '(file . "/dir/file")) makes C-x r j z open /dir/file
+C-x r m is bookmark-set and C-x r j is bookmark-jump
+M-x dired-jump shows the file of the current buffer in a dired buffer
+C-x ( is kmacro-start-macro
+C-x ) is kmacro-end-macro
+C-x e is kmacro-end-and-call-macro
+C-x r m emacs RET sets the bookmark named emacs
+C-x r j emacs RET opens the bookmark named emacs
+C-x r m is bookmark-set, C-x r j is bookmark-jump, and C-x r l is list-bookmarks
+M-x check-parens checks for unbalanced parentheses
+if there is an error parsing .emacs, try to run M-x check-parens
+C-x C-o (delete-blank-lines) replaces blank lines with a single empty line
+M, is tags-loop-continue
+C-x = is what-cursor-position
+C-u C-x = or M-x describe-char shows information about a character
+M-5 C-x e repeats a macro five times
+M-0 C-x e repeats a macro until there is an error
+M-x ff-find-other-file opens a corresponding header or source file
+C-x + is balance-windows
+M-x load-file RET ~/.emacs RET applies changes to ~/.emacs
+C-a C-o inserts a new line above
+C-M-l (reposition-window) makes a definition or comment visible
+C-x < is scroll-left and C-x > is scroll-right
+C-x n d is narrow-to-defun
+q deletes a view mode buffer and e exits view mode
+M-x list-faces-display shows currently defined faces
+M-x list-colors-display lists color names
+C-x C-+ or C-x C-= increases text scale
+M-x global-font-lock-mode toggles font lock mode in all buffers
+M-x customize-group RET font-lock-faces RET allows customizing faces
+M-x replace-regexp RET [0-9]+ RET \,(format "%04d" \#&) RET zero-pads numbers
+M-x find-library RET ido RET opens the elisp source file for ido
+C-u 0 M-t transposes the words ending after the mark and the point
+M-x compare-windows compares text in the current and next window
+C-x i (insert-file) inserts the contents of a file
+M-x write-region writes the region to a file
+M-x append-to-file appends the region to a file
+C-x 6 2 is 2C-two-columns
+C-x 6 b is 2C-associate-buffer
+C-x 6 s is 2C-split
+C-x + is balance-windows
+C-x - is shrink-window-if-larger-than-buffer
+scroll-other-window-down is bound to M-prior and C-M-S-v
+M-ESC ESC deactivates the mark
+C-M-l (reposition-window) makes a definition or comment visible
+C-u C-/ undoes changes within a region when transient mark mode is not enabled
+S-Mouse-3 is ffap-at-mouse nad C-S-Mouse-3 is ffap-menu
+M-v is shift-to-completions in hte minibuffer
+C-x = is what-cursor-position
+F10 is menu-bar-open and M-` is tmm-menubar
+C-u M-; kills a comment and whitespace before the comment
+C-\ is toggle-input-method
+M-g c (goto-char) goes to a buffer position
+
+#unsorted
+url-hexify-string is URL encode and url-unhex-string is URL decode
+lexical-let has been made obsolete
+defadvice and letf are not allowed in Emacs source code
+symbols are case-insensitive in Common Lisp but case-sensitive in Emacs Lisp
+`;;; -*- lexical-binding: t -*-` has enabled lexical binding since 24.1
+point-max is (1+ (buffer-size)) unless narrowing is in effect
+before-advice, after-advice, and around-advice are advice classes
+generate-new-buffer always creates a new buffer
+get-buffer-create returns an existing buffer or creates a new buffer
+s- is super, H- is hyper, and A- is alt
+/* -*- compile-command: "gcc -Wall" -*- */ changes the command for M-x compile
+evil is a successor to vimpulse and vim-mode which are no longer maintained
+viper is a basic vi emulation mode that comes with emacs
+evil, vimpulse, and vim-mode add features like visual selection and text objects
+<right> invokes right-char in Emacs 24 and forward-char in Emacs 23
+ejacs is a JavaScript interpreter written in elisp
+(zerop (length "string")) is constant time
+(equal "string" "string") and (string-equal "string" "string") are linear time
+profile-dotemacs.el runs each sexp through benchmark-run
+the minor-mode-list variable is set to a list of of all minor mode functions
+Emacs regular expressions don't support \d, \w, or \s
+Emacs regular expressions support \` and \' but not \A or \Z
+iswitchb-mode was made obsolete in Emacs 24.4
+mark-active is t if the mark is active
+(read t) reads from the minibuffer or from standard input in batch mode
+(read nil) reads from standard input
+inactive minibuffers have the major mode minibuffer-inactive-mode
+the fifth argument to read-from-minibuffer defaults to minibuffer-history
+(eval-minibuffer "Prompt: ") is like (eval (read-minibuffer "Prompt: "))
+info-apropos searches in info indexes
+apropos-documentation shows symbols whose documentation matches a pattern
+C-h w (where-is) shows what keybindings a function has
+add-to-history removes duplicates if history-delete-duplicates is non-nil
+beginning-of-line-text moves past indentation and a fill prefix
+resize-mini-windows is set to grow-only by default
+max-mini-window-height is set to 0.25 by default
+enable-recursive-minibuffers is nil by default
+the emacs22 completion style is like basic but it ignores text after the point
+the partial-completion completion style splits words around spaces and hyphens
+the initials completion style makes for example lch match list-command-history
+completion-ignored-extensions contains for example .o and ~ by default
+kill-ring-max is 60 by default
+cider used to be called nrepl.el
+bookmarks are saved in ~/.emacs.d/bookmarks
+abnormal hooks end with -hooks or -functions
+scroll-up-command considers scroll-error-top-bottom but scroll-up doesn't
+the vertical-border face is used for the divider in text terminals
+font-lock-maximum-decoration is set to t by default
+fringe-mode affects all frames and set-fringe-style affects the selected frame
+diff-switches is -c by default
+initial-major-mode is lisp-interaction-mode by default
+electric-indent-mode indents when electric-indent-functions returns non-nil
+electric-layout-mode automatically inserts newlines around some characters
+clean-buffer-list kills buffers that have not been displayed recently
+- is no special charset, = is no conversion, and 1 is Latin-1
+C-z (suspend-display) calls iconify-or-deiconify-frame in a graphical display
+DEL is delete-backward-char and <deletechar> is delete-forward-char
+paragraphs are delimited by leading spaces in paragraph-indent-minor-mode
+a special display buffer is always displayed in a dedicated frame
+each symbol has a name, a value cell, a function cell, and a plist
+a disembodied plist is independent of any symbol
+a lambda expression is a sext that evaluates tto a cons whose car is lambda
+an atom is a Lisp entity that is not a cons
+an alist is a list where each element is a cons
+(let ((a 1) (b 3)) (+ a b)) is equivalent to ((lambda (a b) (+ a b)) 1 3)
+-nw (--no-window-system) opens emacs in a terminal ignoring DISPLAY
+--no-site-file disables loading site-start.el
+--debug-init shows information about errors in an init file
+
+#elisp with return values
+(+ (expt (sin .5) 2) (expt (cos .5) 2)) ; 1
+(cons 1 (cons 2 (cons 3 nil))) ; (1 2 3)
+(float 5) ; 5.0
+(apply '+ '(1 2 3)) ; 6
+(concat "aa" "bb") ; "aabb"
+(length "aa") ; 2
+(replace-regexp-in-string "a+" "b" "aac") ; "bc"
+(split-string "a,b" ",") ; ("a" "b")
+(format "%03d" 2) ; "002"
+(string-to-number "3") ; 3
+(number-to-string 3) ; "3"
+(file-name-directory "/dir/file.txt") ; "/dir/"
+(file-name-nondirectory "/dir/file.txt") ; "file.txt"
+(file-name-extension "/dir/file.txt") ; "txt"
+(file-name-sans-extension "/dir/file.txt") ; "/dir/file"
+(lsh 128 -3) ; 16
+(lsh 512 -3) ; 64
+(logior 1 3) ; 3
+(logiand 1 3) ; 1
+(substring "xyz" -1) ; "z"
+(replace-regexp-in-string "[ \t\n]*$" "" "a \t") ; "a"
+(remove 'b '(a b c)) ; (a c)
+(remove-duplicates '(1 1 2)) ; (1 2)
+(remove-duplicates '("a" "a" "b") :test 'string=) ; ("a" "b")
+(nconc '(a b) 'c) ; (a b . c)
+(nconc '(a b) '(c d)) ; (a b c d)
+(append '(a b) '(c d)) ; (a b c d)
+(last '(a b c d e) 2) ; (d e)
+(butlast '(a b c d e) 2) ; (a b c)
+(number-sequence 1 7 3) ; (1 4 7)
+(mapcar 'car '((a b) (c d))) ; (a c)
+(mapcar '1+ [1 2 3]) ; (2 3 4)
+(mapcar* 'cons '(a b) '(1 2)) ; ((a . 1) (b . 2))
+(member "c" '("a" "b")) ; nil
+(expt 16 4) ; 65536
+(regexp-quote "[a].") ; "\\[a\\]\\."
+(string-equal "/" (substring "a/" -1)) ; t
+(read-from-string "abcde") ; (abcde . 5)
+(read-from-string "abcde" 2) ; (cde . 4)
+(prin1-to-string 'aa) ; "aa"
+(all-completions "aa" '(("aab" 1) ("aac" 2) ("bb" 3))) ; ("aab" "aac")
+(/= 15 5) ; t
+(shell-quote-argument "it's") ; "it\\'s"
+(buffer-local-value 'major-mode (get-buffer "*Messages*")) ; fundamental-mode
+(lognot #b1001) ; -10
+(aref [7 8 9] 2) ; 9
+(elt [1 2 3 4] 2) ; 3
+(string (elt "1234" 2)) ; "3"
+
+#elisp config
+(setq rng-nxml-auto-validate-flag nil) ; disable validation by default
+(setq ido-enable-prefix t) ; use prefix matching instead of substring matching
+(add-hook 'markdown-mode-hook (lambda () (variable-pitch-mode t))
+(add-hook 'html-mode-hook (lambda () (auto-fill-mode -1)))
+(unless (server-running-p) (server-start))
+(global-set-key (kbd "<C-f1>" 'ignore)
+(delete '("\\.html?\\'" flymake-xml-init) flymake-allowed-file-name-masks)
+(setq x-stretch-cursor t) ; make the cursor wider over characters like tab
+(setq initial-buffer-choice "~/notes/temp.txt")
+(setq show-paren-style 'expression) ; highlight the whole expression
+(setq disabled-command-hook nil) ; enable all disabled commands
+(setq local-function-key-map (delq '(kp-tab . [9]) local-function-key-map))
+(setq compilation-scroll-output t) ; always scroll a compilation buffer
+(setq compilation-scroll-output 'first-error) ; stop scrolling after an error
+(setq grep-command "grep -PnHe") ; make M-x grep use PCRE
+(setq-default fill-column 80)
+(substitute-key-definition 'kill-buffer 'kill-buffer-and-its-windows global-map)
+(setq browse-url-browser-function 'browse-url-default-macosx-browser)
+(setq confirm-nonexistent-file-or-buffer nil)
+(setq-default line-spacing 0.1)
+(set-register ?e '(file . "~/.emacs")) ; make C-x r j e open ~/.emacs
+(iswitchb-mode) ; bind C-x b to ido-switch-buffer
+(setq comment-auto-fill-only-comments t)
+(add-hook 'c-mode-hook (lambda () (linum-mode 1)))
+(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
+(add-to-list 'completion-ignored-extensions ".orig")
+(setq show-trailing-whitespace t) ; highlight trailing whitespace
+(add-hook 'text-mode-hook 'turn-on-visual-line-mode)
+(substitute-key-definition 'kill-buffer 'kill-buffer-and-its-windows global-map)
+(if (equal "xterm" (tty-type)) (define-key (input-decode-map "\e[1;2A" [S-up])))
+(setq comint-input-ignoredups t) ; don't add repeated commands to the input ring
+(setq tab-always-indent complete) ; complete if the line is already indented
+(comment-or-uncomment-region (line-beginning-position) (line-end-position)))
+(setq x-stretch-cursor t) ; stretch the cursor over wide characters
+(setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring))
+(global-set-key "\M-`" 'other-frame)
+(setq compilation-skip-threshold 2) ; make M-n and M-p skip warnings
+
+#elisp
+(random 3) ; return a random number between 0 and 2
+(set-buffer "*scratch*")
+(kill-buffer "*scratch*")
+(directory-files "/usr/share/emacs/site-lisp/" nil "\\.el$")
+(count-lines (window-start) (window-end))
+(if (null (get-buffer-process (current-buffer))) (kill-buffer))
+(setenv "PATH" (concat (getenv "HOME") "/bin:" (getenv "PATH")))
+(erase-buffer)
+(delete-region 1 10)
+(file-directory-p "/bin")
+(switch-to-buffer (generate-new-buffer "temp"))
+(if (not (one-window-p) (delete-window)))
+(mapc 'kill-buffer (delq (current-buffer) (buffer-list))) ; kill other buffers
+(insert-file-contents "~/file.txt")
+(thing-at-point 'word)
+(thing-at-point 'symbol)
+(bounds-of-thing-at-point 'line)
+(rename-file "/tmp/a" "/tmp/b")
+(delete-char 5) ; delete five characters forward
+(defmacro comment (rest body) nil)
+(kill-new (buffer-file-name)) ; save the name of the buffer to the kill ring
+(browse-url (concat "file://" (buffer-file-name)))
+(propertize "a" 'face 'italic)
+(dotimes (i 20) (insert (format "%d\n" (1+ i))))
+(setq buffer-read-only t)
+(buffer-disable-undo)
+(expand-file-name (concat user-emacs-directory "elisp"))
+(format-kbd-macro (read-key-sequence "key? " nil t))
+(setq mode-line-format nil) ; hide the mode line
+(skip-chars-forward "\n ") ; move to the first character that is not space or \n
+(region-active-p) ; t if transient mark mode is enabled and the mark is active
+(manual-entry (current-word)) ; open a man page for the word near the point
+(let (minibuffer-allow-text-properties) (read-from-minibuffer "Prompt: "))
+(file-name-directory (buffer-file-name))
+(setq echo-keystrokes 0.1) ; echo unfinished commands after 0.1 seconds
+(set-window-text-height (selected-window) 7)
+(text-scale-increase 5)
+(defun xor (a b) (if a (not b) b))
+(select-window (split-window-horizontally))
+(setq history-add-new-input nil) ; don't add elements to minibuffer history
+(read-from-minibuffer "Prompt: ")
+(read-buffer "Buffer: ")
+(read-command "Eval: ")
+(if (looking-at "//") (delete-char 2))
+(string-equal system-type "gnu/linux")
+(erase-buffer)
+(insert-file-contents "file.txt")
+(if (region-active-p) (region-beginning) (line-beginning-position))
+(kill-buffer (current-buffer))
+(switch-to-buffer-other-window "*info*")
+(directory-files "/usr/local") ; names of files and directories
+(directory-files "/usr/local" t) ; absolute paths of files and directories
+(if (> (length (window-list)) 1) (delete-other-windows) (bury-buffer))
+(shell-command-on-region (mark) (point) "python -mjson.tool" (buffer-name) t)))
+(if (and (buffer-modified-p) (buffer-file-name)) (write-file (buffer-file-name))
+(interactive "p") ; prefix arg converted to number
+(interactive "P") ; prefix arg in raw form
+(delete-indentation t) ; delete indentation forward
+(set-frame-parameter nil 'alpha '(85 50))
+(find-alternate-file (concat "/sudo::" (buffer-file-name)))
+(set-frame-parameter (selected-frame) 'fullscreen 'fullboth)
+(floor (* 0.6 (x-display-pixel-width)))
+(>= emacs-major-version 24)
+(kill-region (point) (point-max)) ; delete to the end of a buffer
+(executable-interpret (buffer-file-name))
+(find-function 'f) ; jump to the definition of f
+(symbol-file 'f) ; the file where f is defined
+(if (window-system) (set-frame-height (selected-frame 60))
+(setq message-log-max nil) ; don't add any messages to the messages buffer
+(message "%s" (propertize "message" 'face '(:foreground "red")))
+(read-passwd "Password: ")
+(delq nil (mapcar 'buffer-file-name (buffer-list))) ; files of buffers
+(mapconcat 'identity (delq nil (mapcar 'buffer-file-name (buffer-list))) "\n")
+(set-frame-width (selected-frame) 100)
+(unless (bolp) (beginning-of-line))
+(and (bolp) (eolp)) ; test if the point is on an empty line
+(skip-chars-backward " \t")
+(region-active-p) ; t if the region is active
+(use-region-p) ; t if the region is active and not empty
+(equal last-input-event 'backspace)
+(get-char-property (point) 'face))
+(indent-region (point-min) (point-max)) ; reindent a buffer
+(eq major-mode 'Info-mode)
+(window-buffer) ; buffer of the current window
+(window-buffer (second (window-list)))
+(other-window 1 nil) ; select the next window in the current frame
+(other-window -1 t) ; select the previous window including all frames
+(get-buffer-window "*scratch*") ; the first window that displays *scratch*
+(add-hook 'after-save-hook 'check-parens)
+(select-window (previous-window))
+(global-unset-key "\C-x\C-c")
+(shell-command-on-region (region-beginning) (region-end) "pbcopy")
+(buffer-local-variables)
+(define-obsolete-function-alias f1 f2) ; (defalias f1 f2) (make-obsolete f1)
+(ido-completing-read "Prompt: " '("aa" "bb"))
+(equal (tty-type) "xterm-vt220")
+(setq split-height-threshold nil split-width-threshold 0)
+(setq message-log-max t) ; don't truncate *Messages*
+(if (window-system) (set-frame-height (selected-frame) 60))
+(set-face-attribute 'default nil :height 120)
+(display-graphic-p) ; non-nil if DISPLAY is a graphic display
+
+#manual
+(setq whitespace-style '(face)) enables all visualizations that use special faces
+M-x size-indication-mode shows the buffer size in the mode line
+a line number is not shown if a buffer is larger than line-number-display-limit
+(setq display-time-24hr-format t) uses 24 hour clock for display-time-mode
+display-battery-mode uses battery-mode-line-format
+(set-face-attribute 'mode-line nil :box nil) removes the borders
+(setq mode-line-in-non-selected-windows nil) disables using mode-line-inactive
+Emacs uses the very visible cursor in text terminals by default
+(setq visible-cursor nil) makes Emacs use the visible cursor in text terminals
+(setq cursor-in-non-selected-windows nil) hides cursors in non-selected windows
+M-x toggle-truncate-lines changes the truncate-lines variable locally
+visual-line-mode changes C-a to beginning-of-visual-line
+(setq visible-bell t) uses a visible bell instead of an audible bell
+(setq display-hourglass nil) disables changing the pointer to an hourglass
+hourglass-delay is 1 by default
+(setq make-pointer-invisible nil) disables hiding the pointer when typing
+underline-minimum-offset is 1 by default
+(setq isearch-lazy-highlight nil) disables highlighting other matches
+M-e is isearch-edit-string in isearch-mode-map
+(setq search-whitespace-regexp nil) disables lax space matching for isearch
+M-<TAB> is isearch-complete in isearch-mode-map
+C-w yanks a word, C-M-w deletes a character, and M-s C-e yanks a line
+(setq isearch-allow-scroll t) makes for example C-v and M-v not exit isearch
+C-r searches in minibuffer history when the minibuffer is active
+M-s w is isearch-toggle-word when incremental search is active
+M-s w is isearch-forward-word when incremental search is not active
+M-r is isearch-toggle-regexp
+\= matches the empty string at the point
+\_< matches the beginning of a symbol
+\_> matches the end of a symbol
+\s. matches punctuation characters
+\S- matches non-whitespace characters
+\S. matches non-punctuation characters
+(setq case-fold-search nil) enables considering case
+(setq tags-case-fold-search nil) makes tags operations consider case
+(setq replace-lax-whitespace t) enables lax space matching for query-replace
+\# is 0 during the first replacement, 1 during the second replacement, and so on
+\? prompts for a replacement
+\#& is the whole match converted to a number
+\#1 is the first backreference converted to a number
+M-x multi-isearch-buffers searches in multiple buffers
+M-x occur shows matching lines in a new buffer
+M-3 M-x occurr shows three lines of context before and after each matching line
+pressing RET over a line in an occur buffer shows the line in the original buffer
+C-x ` selects the next occurrence in an occur buffer
+pressing e in an occur buffer enters occur-edit-mode
+C-c C-c exits occur-edit-mode
+list-matching-lines is a synonym for occur
+M-s o runs occur when an incremental search is active
+M-x multi-occur searches in multiple buffers
+M-x multi-occur-in-matching-buffers searches in buffers matching a regexp
+M-x how-many shows the number of matches for a regexp after the point
+M-x undo-only never redoes changes
+undo-limit is 80000 by default and undo-strong-limit is 120000 by default
+undo-outer-limit is 120000000 by default
+C-M-t is transpose-sexps
+M-x ispell applies to region or buffer
+M-x ispell-buffer applies to a buffer and M-x ispell-region applies to a region
+M-x flyspell-prog-mode enables flyspell-mode only for comments and strings
+C-u <F3> adds keys to the last macro after executing it
+C-u C-u <F3> adds keys to the last macro
+(setq kmacro-execute-before-append nil) makes C-u <F3> not execute a macro
+C-x C-k r is apply-macro-to-region-lines
+<F3> is kmacro-start-macro-or-insert-counter
+<F4> is kmacro-end-or-call-macro
+C-x ( is kmacro-start-macro
+C-x ) is kmacro-end-macro
+C-x e is kmacro-end-and-call-macro
+M-4 C-x ) executes a macro four times
+C-x C-k C-n is kmacro-cycle-ring-next
+C-x C-k C-p is kmacro-cycle-ring-previous
+C-x C-k C-i inserts a counter starting from 1
+C-u C-x C-k C-i inserts a counter starting from 0
+C-x C-k C-f specifies a format for the counter
+M-5 C-x C-k C-a adds 5 to the counter
+C-u C-x C-k C-a resets the counter
+C-x q is kbd-macro-query
+C-x C-k b gives a temporary keybinding for the last defined keyboard macro
+C-x C-k b 4 binds the last macro to C-x C-k 4
+C-x C-k n NAME ret gives a command name for the last keyboard macro
+M-x insert-kdb-macro RET NAME RET inserts Lisp code for the NAME macro
+C-x C-k C-e (kmacro-edit-macro) edits the last defined keyboard macro
+C-x C-k l (kmacro-edit-lossage) edits the last 300 keystrokes as a macro
+C-x C-k SPC is kmacro-step-edit-macro
+(setq insert-default-directory nil) disables inserting default-directory
+large-file-warning-threshold is 10000000 by default
+C-x C-v (find-alternate-file) kills the current buffer and visits a new file
+(setq find-file-run-dired nil) disables invoking dired when visiting a directory
+M-x find-file-literally disables format conversion and automatic uncompression
+M-x find-file-literally ignores require-final-newline
+find-file-not-found-functions is run before find-file-hook
+M-~ is not-modified
+C-u M-~ marks the current buffer as changed
+M-x set-visited-file-name changes the name that is used when saving the buffer
+C-u C-x C-s backs up the buffer on next save
+C-u C-u C-x C-s saves the previous file as a backup and saves the buffer
+M-x auto-revert-mode enables auto revert for the current buffer
+(setq global-auto-revert-non-file-buffers t) enables auto revert for all buffers
+the buffer menu reverts automatically every auto-revert-interval seconds
+(setq auto-save-visited-file-name t) performs auto-save in place
+(setq delete-auto-save-files nil) disables deleting auto-save files on save
+auto-save-interval is 300 by default and auto-save-timeout is 30 by default
+M-x recover-file restores an auto-save file
+M-x recover-session recovers auto-save files from the previous session
+(setq find-file-visit-truename t) enables resolving symlinks when visiting files
+C-u C-x C-d shows a verbose directory listing
+list-directory-brief-switches is -CF by default
+list-directory-verbose-switches is -l by default
+(setq delete-by-moving-to-trash t) makes M-x delete-file use the trash
+diff-switches is -c by default
+M-n is diff-hunk-next in diff-mode
+M-x make-symbolic-link creates a symbolic link
+M-x add-name-to-file creates a hard link
+chmod is an alias for set-file-modes
+M-x chmod changes the mode of a file
+e extracts a file in tar-mode
+v opens a file in view mode in tar-mode
+o opens a file in a new window in tar-mode
+(setq ange-ftp-make-backup-files t) enables backups for files accessed via ftp
+C-<tab> completes from the file name cache in the minibuffer
+M-x file-cache-add-directory RET /dir RET adds files in /dir to the file cache
+M-x recentf-save-list saves the recentf-file-list to a file
+(filesets-init) enables filesets
+M-x filesets-add-buffer RET NAME RET adds a buffer to the fileset NAME
+M-x filesets-open visits all files in a fileset
+C-u M-g M-g goes to a line in the previous buffer
+M-x view-buffer opens a buffer in view-mode
+M-x kill-matching-buffers kills buffers that match a regexp
+M-x clean-buffer-list kills buffers that have not been visited in three days
+midnight-hook includes clean-buffer-list by default
+C-x 4 c is clone-indirect-buffer-other-window
+truncate-partial-width-windows is 50 by default
+C-x 4 C-o is iswitchb-display-buffer
+C-x 4 C-o opens a buffer in another window without selecting the window
+C-x 4 0 is kill-buffer-and-window
+C-x ^ (enlarge-window) makes a window taller horizontally
+C-x - is shrink-window-if-larger-than-buffer
+C-x + (balance-windows) makes windows the same width or height
+buffers in same-window-buffer-names are always displayed in the selected window
+(setq pop-up-frames t) makes display-buffer create new frames
+M-x follow-mode makes windows display adjacent sections of the same buffer
+(windmove-default-keybindings) binds for example <S-right> to windmove-right
+C-x 5 1 is delete-other-frames
+C-x 5 2 (make-frame-command) creates a frame and switches to it
+M-x creates a speedbar associated with the current frame
+(setq use-dialog-box nil) makes mouse commands not use graphical dialogs
+enable-multibyte-characters is non-nil in multibyte buffers
+M-x toggle-enable-multibyte-characters disables multibyte support in a buffer
+C-h L is describe-language-environment
+C-h L UTF RET describes the UTF-8 language environment
+exit-language-environment-hook is run before set-language-environment-hook
+C-h C is describe-coding-system
+C-h C utf-8-unix RET  describes the utf-8-unix coding system
+the raw-text coding system sets enable-multibyte-characters to nil
+C-x RET r is revert-buffer-with-coding-system
+C-x RET f dos RET saves a file with CRLF line endings
+emacs -fn fontset-standard uses the standard fontset instead of the default fontset
+standard-fontset-spec is -*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard
+the japanese-jisx0208 charset has the highest priority in the Japanese language environment
+C-u C-x = shows the character set of a character
+(setq-default major-mode 'text-mode) uses text-mode instead of fundamental-mode
+-*-Lisp-*- is equivalent to -*-mode:Lisp;-*-
+interpreter-mode-alist contains elements like ("bash" . sh-mode)
+auto-mode-alist contains elements like ("\\.rb\\'" . ruby-mode) and ("\\.bz2\\'" nil jka-compr)
+magic-fallback-mode-alist contains elements like ("<\\?xml " . xml-mode)
+M-x indent-relative indents a line to have the same indentation level as the previous non-blank line
+C-M-o is split-line
+(setq indent-tabs-mode nil) makes indentation commands use spaces
+M-x untabify converts tabs to spaces based on tab-width
+indent-for-tab-command is t by default
+(setq indent-for-tab-command t) makes tab attempt completion if the current line is already indented
+(setq indent-for-tab-command nil) makes tab indent only at the left margin and the indentation
+C-x [ is backward-page, C-x C-p is mark-page, and C-x l is count-lines-page
+C-x f is set-fill-column
+M-o M-s (center-line) centers a line within the current fill column
+breaking a line is disabled if a function in fill-nobreak-predicate returns non-nil
+C-x . is set-fill-prefix
+M-x fill-individual-paragraphs fills a region considering changes in indentation as paragraph boundaries
+lines that don't start with the fill prefix are considered to start a paragraph
+M-<TAB> is ispell-complete-word in text mode
+entering outline mode runs text-mode-hook followed by outline-mode-hook
+outline-mde uses C-c as a prefix and outline-minor-mode uses C-c @ as a prefix
+C-c C-n is outline-next-visible-heading in outline-mode
+C-c C-f is outline-forward-same-level and C-c C-u is outline-up-heading in outline-mode
+C-c C-c is hide-entry and C-c C-e is show-entry in outline mode
+M-x reveal-mode enables automatically unhiding text near point in outline mode
+(eval-after-load "outline" '(require 'foldout)) adds folding commands to outline mode
+foldout binds C-c C-z to foldout-zoom-subtree in outline mode
+C-c C-t is org-todo, C-c C-s is org-schedule, and C-c C-d is org-deadline
+tex-default-mode is latex-mode by default
+latex-mode, plain-tex-mode, and doctex-mode are child modes of tex-mode
+C-c { (tex-insert-braces) inserts braces and positions the point between them in tex-mode
+C-c } (up-list) moves to the next closing brace in tex-mode
+C-c C-o (tex-latex-block) inserts \begin and \end in latex-mode
+C-c C-e is tex-close-latex-block in latex-mode
+latex-electric-env-pair-mode inserts \end tags automatically
+C-c C-b is tex-buffer, C-c C-r is tex-region, and C-c C-f is tex-file
+C-c C-p is tex-print
+C-c C-v (tex-view) shows the output of a command like tex-buffer in an external program
+C-c C-v uses tex-dvi-view-command and C-c C-p uses tex-dvi-print-command
+C-c C-l scrolls a *tex-shell* buffer so that the last line is visible
+C-c C-k is tex-kill-job
+the header used by C-c C-r starts with \documentclass or \documentstyle in latex mode
+tex-start-commands is "\\nonstopmode\\input" by default
+C-c <TAB> (tex-bibtex-file) runs tex-bibtex-command to produce a .bbl file
+C-c C-n (sgml-name-char) inserts a named entity in sgml mode and HTML mode
+C-c C-t (sgml-tag) inserts an opening and closing tag
+C-c / is sgml-close-tag
+C-c C-f is sgml-skip-tag-forward and C-c C-d is sgml-delete-tag
+2C-two-columns is bound to <F2> 2 and C-x 6 2
+C-M-h is c-mark-function in C mode
+M-x imenu jumps to a definition
+M-x indent-code-rigidly indents code but not comments or strings
+C-M-q is indent-pp-sexp in Lisp mode and c-indent-exp in C mode
+C-c C-q is c-indent-defun in C mode
+<TAB> is c-indent-command in C mode
+c-tab-always-indent is t by default
+C-c . (c-set-style) changes indentation style in C mode
+C-M-<SPC> is mark-sexp
+C-M-n is forward-list, and C-M-p is backward-list
+C-M-u is backward-up-list and C-M-d is down-list
+blink-matching-delay is 1 by default
+C-u M-; (comment-kill) kills a comment on the current line
+C-x ; is comment-set-column
+comment-region is bound to C-c C-c in C-like modes
+c-indent-comment-alist changes the behavior of M-;
+C-h S is info-lookup-symbol
+C-c @ C-h is hs-hide-block and C-c @ C-s is hs-show-block
+C-c @ C-c is hs-toggle-hiding
+C-c @ C-M-h is hs-hide-all and C-c @ C-M-s is hs-show-all
+C-c @ C-l is hs-hide-level
+(setq hs-hide-comments-when-hiding-all t) makes hs-hide-all also hide comments
+hs-isearch-open is set to code by default
+C-M-i is completion-at-point in many programming modes
+completion-at-point uses semantic parser data for completion when semantic mode is enabled
+M-x glasses-mode adds underscores to camel case words
+M-x semantic-mode makes some modes use a semantic parser instead of syntax tables
+semantic mode understands C, C++, Scheme, JavaScript, Java, HTML, and Make
+C-c , j is semantic-complete-jump-local and C-c , J is semantic-complete-jump
+C-c , <SPC> (semantic-complete-analyze-inline) shows a list of completions for a symbol at point
+C-c , l (semantic-analyze-possible-completions) shows a list of completions in another window
+C-c C-l is c-toggle-electric-state and C-c C-a is c-toggle-auto-newline
+C-c <DEL> (c-hungry-delete-backwards) deletes whitespace before the point
+C-c C-d (c-hungry-delete-forward) deletes whitespace after the point
+(subword-mode 1) enables treating uppercase characters in camelcase identifiers as word boundaries
+C-c C-s (c-show-syntactic-information) shows syntactic information abount the current line
+cwarn-mode highlights for example assignments inside expressions and semicolons after if, for, and while
+M-x ff-find-related-file finds a corresponding header or source file
+M-x recompile invokes a compiler with the same command as the last invocation of M-x compile
+the default compile-command is make -k where -k continues after errors
+M-g n is next-error and M-g p is previous-error
+M-} is compilation-next-file and M-{ is compilation-previous-file in compilation mode
+C-c C-f toggles next-error-follow-minor-mode in compilation mode
+compilation-skip-threshold is set to 1 by default
+(setq compilation-skip-threshold 2) makes next-error and previous-error also skip warnings
+compilation-error-regexp-alist is used to match errors
+find-grep is an alias for grep-find
+(setq grep-highlight-matches t) enables --color
+M-x lgrep is like M-x grep but it uses prompts to construct the grep command
+M-x rgrep is like M-x grep-find but it uses prompts to construct the grep command
+grep-files-aliases makes for example ch match *.[ch]
+grep-find-ignored-directories is used by rgrep but not grep-find
+grep-find-ignored-directories includes for example .git and .svn by default

File osx/lri.me/files.txt

+## js
+
+    'AA'.toLowerCase() // 'aa'
+    'abcd'.indexOf('bc')!=-1 // true
+    'aa'.replace('a','b') // 'ba'
+    'aa'.replace(/a/g,'b') // 'bb'
+    'abc'.charAt(2) // 'c'
+    'abc'.slice(-2) // 'bc'
+    'aa'<'ab' // true
+    ' a '.trim() // 'a'
+    ' a '.trimRight() // ' a'
+    s='some string';s.charAt(0).toUpperCase()+s.slice(1) // 'Some string'
+    String.fromCharCode(65) // 'A'
+    'string'.indexOf('str')==0 // true
+    s='string';end='ing';s.indexOf(end,s.length-end.length)!=-1 // true
+    'bca'.split('').sort.join('') // 'abc'
+    [1,2].indexOf(2) // 1
+    a=[1,2];a.push(3);a // [1, 2, 3]
+    a=[1,2,3];a.pop();a // [1, 2]
+    a=[1,2,3];a.shift();a // [2, 3]
+    a=[3,4];a.unshift(1,2);a // [1, 2, 3, 4]
+    [1,2].concat(3,4) // [1, 2, 3, 4]
+    [1,2,3,4,5].slice(2,4) // [3, 4]
+    a=['a','b','d'];a.splice(2,0,'c');a // ['a', 'b', 'c', 'd']
+    a=[];for(i=0;i<=3;i++){a.push(i)};a // [0, 1, 2, 3]
+    a=['a','b','x','x','e'];a.splice(2,2);a // ['a', 'b', 'e']
+    a=['a','b','x','x','e'];a.splice(2,2,'c','d');a // ['a', 'b', 'c', 'd', 'e']
+    [2,3,1].sort().reverse() // [3, 2, 1]
+    'abab'.lastIndexOf('b') // 3
+    a=[1,2,3,4];i=a.indexOf(3);if(i>-1)a.splice(i,1);a // [1, 2, 4]
+    a=[0,0];a[5]=0;Object.keys(a) // ['0', '1', '5']
+    a=[0,0];a[5]=0;a.length // 6
+    ['a','b'].join('') // 'ab'
+    ['a','b'].join() // 'a,b'
+    ['11','2'].sort(parseInt) // ['2', '11']
+    ['--','---','-'].sort(function(x,y){return x.length>y.length}) // ['-', '--', '---']
+    a=[1,2];2 in a // true
+    o={};o.foo=1;o // {foo: 1}
+    Object.keys({a:1,b:2}).length # 2
+    o={a:1};'a' in o // true
+    Math.abs(-2) // 2
+    Math.cos(Math.PI) // -1
+    Math.log(Math.exp(3)) // 3
+    Math.log(Math.pow(Math.E,3)) // 3
+    Math.max(1,2) // 2
+    Math.round(Math.pow(125,(1.0/3))) // 5
+    '0089'.replace(/^0+/,'') // '89'
+    '0a1b'.match(/\d(?=a)/) // ['0']
+    '0a1b'.match(/\d(?!a)/) // ['1']
+    ' \t a '.replace(/^\s+|\s+$/g,'') // 'a'
+    new RegExp('a+','ig') // /a+/ig
+    var x;typeof x // 'undefined'
+    0=='' // true
+    0=='0' // true
+    null==undefined // true
+    false==undefined // false
+    false==null // false
+    typeof(new String('a')) // 'object'
+    typeof('a') // 'string'
+    eval('2+2') // 4
+    eval(new String('2+2')) // {'0': '2', '1': '+', '2': '2'}
+    eval((new String('2+2')).valueOf()) // 4
+    [4,9].map(Math.sqrt) // [2, 3]
+    ['1','2'].map(function(x){return parseInt(x)}) // [1, 2]
+    [1,'2',3].filter(function(x){return typeof x=='number'}) // [1, 3]
+    [1,'2',3].some(isNumber) // true
+    [1,'2',3].every(isNumber) // false
+    [1,2,3,4].reduce(function(x,y){return x*y}) // 24
+    [[0,1],[2,3]].reduce(function(x,y){return x.concat(y)} // [0, 1, 2, 3]
+    Array.apply(null,{length:4}).map(Number.call,Number) // [0, 1, 2, 3]
+    Array.prototype.map.call("ab",function(x){return x.charCodeAt(0)}) // [97, 98]
+    a=[1,2,3,4];a.reduce(function(x,y){return x+y})*1.0/a.length // 2.5
+    JSON.parse('{"a":1}') // {a: 1}
+    JSON.stringify({a:1}) // '{"a":1}'
+    Date.UTC(2013,12,31,23,59,59) // 1391212799000
+    ('000'+789).slice(-4) // '0789'
+    (1e4+789+'').substr(1) // '0789'
+    encodeURIComponent('H & M') // 'H%20%26%20M'
+    decodeURIComponent('H%20%26%20M') // 'H & M'
+    function f(){return Array.prototype.slice.call(arguments,0)};f(1,2) // [1, 2]
+    p=1;a=[1,2,3,4];for(i=0;i<a.length;i++){p*=a[i]};p // 24
+    new Array(5+1).join('x') // 'xxxxx'
+    (new Number(33)).toString(2) // '100001'
+    [2,3].map(x=>x*x) // [4, 9]
+
+## readinglist
+
+    #emacs
+    http://www.emacswiki.org/emacs/goto-chg.el
+    https://github.com/purcell/whole-line-or-region/blob/master/whole-line-or-region.el
+    http://stackoverflow.com/questions/206806/filtering-text-through-a-shell-command-in-emacs/207067#207067
+    http://stackoverflow.com/questions/88399/how-do-i-duplicate-a-whole-line-in-emacs/4717026#4717026
+    http://whattheemacsd.com/
+    http://stackoverflow.com/questions/6397323/how-to-avoid-the-message-of-server-start-while-opening-another-emacs-session
+    http://stackoverflow.com/questions/4987760/how-to-change-size-of-split-screen-emacs-windows/4988206#4988206
+    https://github.com/technomancy/better-defaults
+    https://raw.github.com/adambard/learnxinyminutes-docs/master/elisp.html.markdown
+    http://sachachua.com/blog/2013/03/emacs-chat-with-avdi-grimm-org-mode-ruby-etc/
+    http://www.fincher.org/tips/Languages/Emacs.shtml
+    http://ep.yimg.com/ty/cdn/paulgraham/jmc.ps
+    http://steve-yegge.blogspot.com/2008_01_01_archive.html
+    http://ergoemacs.org/emacs/elisp_common_functions.html
+    http://ergoemacs.org/emacs/elisp_examples.html
+    http://ergoemacs.org/emacs/emacs_package_system.html
+    http://www.cs.berkeley.edu/~christos/classics/lisp.ps
+    http://www.gnu.org/software/emacs/manual/html_node/cl/Porting-Common-Lisp.html
+    http://ep.yimg.com/ty/cdn/paulgraham/acl2.txt
+    https://github.com/Fuco1/free-keys
+    http://www.masteringemacs.org/articles/2013/10/10/wdired-editable-dired-buffers/
+    http://www.emacswiki.org/emacs/BackquoteSyntax
+    http://www.emacswiki.org/emacs/EmacsLispIntrospection
+    http://www.emacswiki.org/emacs/ListStructure
+    https://sites.google.com/site/steveyegge2/my-dot-emacs-file
+    http://www.emacswiki.org/emacs/KillingBuffers
+    http://www.emacswiki.org/emacs/misc-cmds.el
+    http://milkbox.net/note/single-file-master-emacs-configuration/
+    http://stackoverflow.com/questions/6590889/how-emacs-determines-a-unit-of-work-to-undo/6593906#6593906
+    https://github.com/nonsequitur/smex/blob/master/README.markdown
+    http://stackoverflow.com/questions/605846/how-do-i-access-the-contents-of-the-current-region-in-emacs-lisp/605931#605931
+    http://stackoverflow.com/questions/1792326/how-do-i-bind-a-command-to-c-i-without-changing-tab/1792482#1792482
+    http://www.nongnu.org/emacs-tiny-tools/keybindings/
+    http://stackoverflow.com/questions/16801396/when-should-emacs-function-syntax-be-used/16802304#16802304
+    http://stackoverflow.com/questions/611831/how-to-url-decode-a-string-in-emacs-lisp
+    http://stackoverflow.com/questions/14291260/difference-between-viper-vimpulse-and-evil-for-emacs/14293997#14293997
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html
+    http://www.masteringemacs.org
+    http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/etc/NEWS
+    http://emacsredux.com/blog/2013/05/31/highlight-lines-that-exceed-a-certain-length-limit/
+    http://ramenlabs.com/2011/12/29/using-perl-compatible-regular-expressions-in-emacs/
+    http://www.emacswiki.org/emacs/RegularExpression#toc2
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Char-Classes.html#Char-Classes
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table
+    http://irreal.org/blog/?p=1520
+    http://ergoemacs.org/emacs/emacs24_features.html
+    http://ergoemacs.org/emacs/emacs23_features.html
+    http://ergoemacs.org/emacs/emacs23.2_features.html
+    https://code.google.com/p/js2-mode/
+    https://github.com/kaushalmodi/.emacs.d/blob/master/init.el
+    https://plus.google.com/communities/114815898697665598016
+    https://github.com/ShingoFukuyama/helm-swoop
+    http://emacsredux.com/blog/2014/02/02/a-peek-at-emacs-24-dot-4-new-string-manipulation-functions/
+    http://ergoemacs.org/emacs/file_management.html
+    http://ergoemacs.org/emacs/emacs_dired_tips.html
+    http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html
+    http://www.emacswiki.org/emacs/MidnightMode
+    http://skybert.net/emacs/a-handful-packages-that-will-turbo-boost-your-emacs/
+    https://github.com/nonsequitur/smex
+    http://stackoverflow.com/questions/2423834/move-line-region-up-and-down-in-emacs/12512671#12512671
+    http://emacsredux.com/blog/2013/06/21/eval-and-replace/
+    https://gist.github.com/chaitanyagupta/9324402
+    https://github.com/gempesaw/ido-vertical-mode.el
+    http://snarfed.org/why_i_run_shells_inside_emacs
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Writing-to-Files.html
+    http://www.emacswiki.org/emacs/AutoIndentation
+    http://www.emacswiki.org/emacs/ElispCookbook
+    https://gist.github.com/lateau/4511988
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Contents.html
+    http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html
+    http://stackoverflow.com/questions/13186811/emacs-extending-expanding-region-so-that-it-embraces-whole-lines
+    http://stackoverflow.com/questions/778716/how-can-i-make-emacs-start-up-faster
+    http://stackoverflow.com/questions/2588277/how-can-i-swap-or-replace-multiple-strings-in-code-at-the-same-time
+    http://stackoverflow.com/questions/8362188/evaluating-a-buffer-based-on-filetype-in-emacs/8362276#8362276
+    http://www.masteringemacs.org/articles/2011/12/12/what-is-new-in-emacs-24-part-2/
+    http://www.gnu.org/software/emacs/news/NEWS.24.3
+    http://emacsredux.com/blog/2013/04/21/edit-files-as-root/
+    https://github.com/magnars/.emacs.d/blob/master/key-bindings.el
+    https://github.com/magnars/multiple-cursors.el
+    https://github.com/search?q=language%3Aemacs-lisp&s=stars
+    https://github.com/trending?l=emacs-lisp
+    https://github.com/purcell/emacs.d/tree/master/lisp
+    https://github.com/purcell/emacs.d/blob/master/lisp/init-nxml.el
+    https://github.com/purcell/emacs.d/blob/master/lisp/init-utils.el
+    http://www.emacswiki.org/emacs/ListModification
+    http://www.wilfred.me.uk/blog/2013/06/29/multi-paradigm-adventures/
+    http://melpa.milkbox.net/#/
+    https://github.com/rejeep/emacs/blob/master/defuns.el
+    http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html
+    http://dgutov.github.io/blog/2013/04/07/emacs-24-dot-3-s-killer-feature-eager-macro-expansion/
+    https://github.com/dgutov/dot-emacs/blob/master/site-lisp/defuns.el
+    https://www.youtube.com/watch?v=ytNsHmRLZGM&feature=youtu.be
+    https://github.com/jwiegley/dot-emacs/blob/master/lisp/copy-code.el
+    https://github.com/jwiegley/dot-emacs
+    https://github.com/jwiegley/dot-emacs/blob/master/init.el
+
+    #osx
+    http://support.apple.com/kb/ht2674
+    http://refit.sourceforge.net/myths
+    http://superuser.com/questions/357159/osx-terminal-showing-incorrect-hostname
+    http://superuser.com/questions/594023/what-does-the-default-etc-profile-on-mac-os-x-10-8-look-like
+    http://apple.stackexchange.com/questions/12387/how-to-send-an-email-from-command-line/40142#40142
+    http://apple.stackexchange.com/questions/6278/how-to-securely-erase-an-ssd-drive
+    http://www.insanelymac.com/forum/topic/99891-osx-flags-list-for-darwin-bootloader-kernel-level/
+    https://github.com/mxcl/homebrew/wiki
+    http://superuser.com/questions/295151/mac-os-x-is-there-a-straightforward-way-to-color-ls-output-according-to-finder
+    http://superuser.com/questions/370622/how-is-load-average-calculated-on-osx-it-seems-too-high-and-how-do-i-analyze
+    http://superuser.com/questions/279891/list-all-members-of-a-group-mac-os-x
+    http://help.bombich.com/kb/advanced-strategies/the-disk-center
+    http://images.apple.com/osx/preview/docs/OSX_Mavericks_Core_Technology_Overview.pdf
+    http://support.apple.com/kb/HT5606
+    https://developer.apple.com/library/mac/#technotes/tn2083/_index.html
+    http://superuser.com/questions/302754/increase-the-maximum-number-of-open-file-descriptors-in-snow-leopard
+    http://apple.stackexchange.com/questions/61901/is-t-there-a-way-to-load-a-launchagent-as-another-user
+    https://developer.apple.com/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_8.html
+    http://blog.macromates.com/2012/nested-replacements/
+    http://ridiculousfish.com/blog/posts/The-app-that-was-fixed-by-a-crash.html
+    http://code.google.com/p/iterm2/wiki/Keybindings
+    http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
+    http://web.archive.org/web/20061017080159/http://developer.apple.com/macosx/launchd.html
+    https://dl.dropbox.com/u/46870715/s/m10lmac8.html
+    http://lists.apple.com/archives/darwin-dev/2011/Mar/msg00036.html
+    http://arstechnica.com/apple/2005/04/macosx-10-4/6/
+    http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=FAQ
+    http://support.apple.com/kb/ht1379
+    http://cansecwest.com/csw09/csw09-daizovi-miller.pdf
+    http://www.frameloss.org/2011/09/05/cracking-macos-lion-passwords/
+    https://github.com/mxcl/homebrew/wiki/FAQ
+    http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html
+    http://wiki.freegeek.org/index.php/Mac_Commandline_Tools
+    http://stevelosh.com/blog/2012/10/a-modern-space-cadet/
+    http://aplawrence.com/MacOSX/acl.html
+    http://triviaware.com/macprocess/all
+    http://training.apple.com/pdf/wp_osx_security.pdf
+    http://support.apple.com/kb/ht5394
+    http://rixstep.com/2/2/20070718,00.shtml
+    http://www.wsanchez.net/papers/USENIX_2000/
+    https://docs.google.com/spreadsheet/ccc?key=0AkBdGlxJhW-ydDlxVUxWUVU0dXVzMzUxRzh2b2ZzaFE
+    http://apple.stackexchange.com/questions/5165
+    http://superuser.com/questions/202814/what-is-an-equivalent-of-the-adduser-command-on-mac-os-x
+    http://onlyinhopesofdreaming.blogspot.fi/2013/07/command-line-favorites-1.html
+    http://en.wikipedia.org/wiki/HFS_Plus
+    http://apple.stackexchange.com/questions/98389/in-disk-utility-what-advantages-do-read-write-disk-images-have-over-sparse-b
+    https://github.com/osxfuse/osxfuse/wiki/FAQ
+    http://apple.stackexchange.com/questions/87282/in-mountain-lion-how-do-i-set-the-path-environment-variable-unified-for-all-newl
+    https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#//apple_ref/doc/uid/DTS10002989
+    http://derflounder.wordpress.com/2012/07/25/using-fdesetup-with-mountain-lions-filevault-2/
+    http://superuser.com/questions/134864/log-of-cron-actions-on-os-x
+    http://apple.stackexchange.com/questions/46253/what-is-the-best-way-to-clone-a-disk-between-two-macs
+    http://lists.apple.com/archives/filesystem-dev/2012/Feb/msg00015.html
+    http://filexray.com/fileXray.pdf
+    http://osxbook.com/blog/
+    http://dubeiko.com/development/FileSystems/HFSPLUS/tn1150.html
+    http://superuser.com/questions/176361/mount-external-usb-drive-in-single-user-mode
+    http://hea-www.harvard.edu/~fine/OSX/path_helper.html
+    http://apple.stackexchange.com/a/104099
+    http://support.apple.com/kb/HT1757
+    http://arstechnica.com/apple/2011/07/mac-os-x-10-7/12/#hfs-problems
+    http://hints.macworld.com/article.php?story=20090902223042255
+    http://ilostmynotes.blogspot.de/2012/06/gatekeeper-xprotect-and-quarantine.html
+    http://arcticmac.home.comcast.net/~arcticmac/tutorials/gdbFindingPrefs.html
+    http://api.stackexchange.com/2.1/users/427/answers?pagesize=100&order=desc&sort=activity&site=apple&filter=!bFN2MqFu-JdrhV
+    http://osxbook.com/blog/2009/03/02/why-macfuse-installation-recommends-a-reboot/
+    http://furbo.org/2013/10/17/code-signing-and-mavericks/
+    http://www.onthelambda.com/2013/10/14/the-state-of-package-management-on-mac-os-x/
+    https://developer.apple.com/library/mac/documentation/carbon/conceptual/spotlightquery/concepts/queryformat.html
+    http://superuser.com/questions/509990/how-do-i-revert-to-having-sudo-ask-for-a-password-again
+    http://stackoverflow.com/questions/1715580/how-to-discover-number-of-cores-on-mac-os-x
+    https://gist.github.com/cobyism/6839439
+    http://arstechnica.com/apple/2013/10/os-x-10-9/15/
+    http://apple.stackexchange.com/a/106942
+    http://apple.stackexchange.com/questions/107292/adding-apps-to-security-privacy-settings-automatically
+    http://c-command.com/dropdmg/manual-ah/format
+    http://www.tonymacx86.com/374-unibeast-install-os-x-mavericks-any-supported-intel-based-pc.html
+    http://www.rodsbooks.com/ubuntu-efi/
+    https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_9.html#//apple_ref/doc/uid/TP40013207-SW14
+    http://ntk.me/2012/09/07/os-x-on-os-x/
+    http://hints.macworld.com/article.php?story=20130908042828630
+    http://apple.stackexchange.com/questions/107292/adding-apps-to-security-privacy-settings-automatically/107293#107293
+    http://stackoverflow.com/questions/4892555/how-to-capture-frames-from-apple-isight-using-python-and-pyobjc
+    http://apple.stackexchange.com/questions/55780/how-can-i-tell-which-application-is-using-the-network
+    https://developer.apple.com/library/mac/documentation/performance/conceptual/managingmemory/articles/aboutmemory.html
+    http://support.apple.com/kb/PH10670
+    http://binchewer.org/blog/index.php?id=1
+    http://opensource.apple.com/tarballs/bash/
+    http://thepiratebay.se/search/serialbox/0/7/0
+    http://support.apple.com/kb/ht4878
+    https://plus.google.com/+YuriyNemtsov/posts/NiRiDkTcvS8
+    http://www.macworld.com/article/1163620/how_to_upgrade_tracks_to_itunes_match_fast.html
+    http://support.apple.com/kb/TS4124?viewlocale=en_US&locale=en_US
+    http://itunesclean.blogspot.fi/
+    http://apple.stackexchange.com/questions/118594/os-x-application-start-stop-hook/118617#118617
+    https://github.com/ptb/Mac-OS-X-Lion-Setup/blob/master/setup.sh
+    http://www.vankuik.nl/2013-10-25_What_is_new_in_OS_X_Mavericks
+    https://www.torproject.org/docs/tor-doc-osx.html.en
+    http://help.bombich.com/kb/troubleshooting/how-long-should-the-clone-or-backup-take
+    http://help.bombich.com/kb/troubleshooting/what-makes-a-volume-bootable
+    http://www.bombich.com/software/docs/CCC/Carbon%20Copy%20Cloner%20Documentation.pdf
+    http://apple.stackexchange.com/questions/54993/how-do-i-delete-a-bootcamp-partition-using-terminals-diskutil
+    http://www.bombich.com/software/docs/CCC/en.lproj/explore/some-files-and-folders-are-automatically-excluded-from-a-backup-task.html
+    http://pondini.org/TM/A6.html
+    https://gist.github.com/lmullen/4736568
+    https://developer.apple.com/library/mac/documentation/macosx/conceptual/bpsystemstartup/chapters/CreatingLoginItems.html
+    https://github.com/ianyh/Amethyst/blob/master/Amethyst/default.amethyst
+    http://jxpx777.com/blog/20131217-simple-json-processing-in-shell-scripts
+    http://apple.stackexchange.com/questions/112100/what-is-the-use-of-snapshot-db
+    http://dtrace.org/blogs/brendan/2011/10/10/top-10-dtrace-scripts-for-mac-os-x/
+    http://dtracebook.com/index.php/File_System:maclife.d
+    http://dtracebook.com/index.php/Network_Lower_Level_Protocols:soconnect.d#Mac_OS_X
+    http://prefetch.net/articles/solaris.dtracetopten.html
+    http://www.tonymacx86.com/wiki/index.php/Org.chameleon.Boot.plist#System_Boot_Options
+    http://arstechnica.com/civis/viewtopic.php?f=19&t=1160047
+    http://www.robmeerman.co.uk/osx/start#ssh_commands_don_t_load_bashrc
+    http://launchd.info/
+    https://github.com/phinze/homebrew-cask
+    https://code.google.com/p/macfuse/wiki/OPTIONS
+    http://support.apple.com/kb/ht5343
+
+    #other
+    http://www.unicode.org/glossary/
+    http://gdata.youtube.com/demo/index.html
+    https://en.wikipedia.org/wiki/Mathematical_logic
+    http://throwingfire.com/storing-passwords-securely
+    http://ridiculousfish.com/blog/posts/colors.html
+    http://ridiculousfish.com/blog/posts/float.html
+    http://lucumr.pocoo.org/2012/10/18/such-a-little-thing/
+    http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
+    http://chrisdone.com/z/
+    http://matt.might.net/articles/grammars-bnf-ebnf/
+    http://jeremykun.com/2013/01/22/depth-and-breadth-first-search/
+    http://www.openwall.com/presentations/Passwords12-The-Future-Of-Hashing/
+    http://blog.zorinaq.com/?e=74
+    http://www.wall.org/%7Elarry/natural.html
+    http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
+    http://www.cl.cam.ac.uk/~mgk25/unicode.html
+    http://unicode.org/reports/tr15/
+    http://www.unicode.org/faq/normalization.html
+    http://blog.macromates.com/2005/handling-encodings-utf-8/
+    https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown
+    http://johnmacfarlane.net/pandoc/README.html
+    http://docs.python.org/2/tutorial/stdlib2.html
+    http://norvig.com/mayzner.html
+    http://books.google.com/ngrams/info
+    http://www.cambridgeincolour.com/tutorials/color-space-conversion.htm
+    http://cameratico.com/guides/web-browser-color-management-guide/
+    https://trac.handbrake.fr/wiki/Containers
+    https://trac.handbrake.fr/wiki/Encoders
+    https://en.wikipedia.org/wiki/Advanced_Audio_Coding
+    http://www-formal.stanford.edu/jmc/recursive.pdf
+    http://calculus.seas.upenn.edu/
+    http://en.wikipedia.org/wiki/C0_and_C1_control_codes
+    http://unix.stackexchange.com/questions/36841/why-is-number-of-open-files-limited-in-linux
+    http://cm.bell-labs.com/cm/cs/who/dmr/retro.html
+    http://www.pathname.com/fhs/pub/fhs-2.3.html
+    http://www.textfiles.com/programming/25th_ann.uni
+    http://www.freebsd.org/doc/en/articles/explaining-bsd/article.html
+    http://csapp.cs.cmu.edu/public/docs/chistory.html
+    http://www.norvig.com/python-lisp.html
+    http://www.i2p2.de/how_intro
+    http://en.wikipedia.org/wiki/Inverse_trigonometric_functions
+    http://slhck.info/video-encoding.html
+    https://en.wikipedia.org/wiki/Berkeley_Software_Distribution
+    http://stackoverflow.com/questions/1911022/what-are-all-the-html-escaping-contexts
+    https://en.wikipedia.org/wiki/XML
+    http://tools.ietf.org/html/rfc20
+    https://en.wikipedia.org/wiki/Cryptographic_hash_function
+    http://www.unicode.org/faq/utf_bom.html
+    http://www.w3schools.com/xpath/xpath_syntax.asp
+    http://ejohn.org/blog/xpath-css-selectors/
+    http://serverfault.com/questions/282555/zeroing-ssd-drives
+    http://static.usenix.org/events/fast11/tech/full_papers/Wei.pdf
+    http://pubs.opengroup.org/onlinepubs/9699919799/frontmatter/preface.html
+    http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
+    http://www.opengroup.org/austin/docs/austin_236.txt
+    http://www.validlab.com/goldberg/paper.pdf
+    http://www.gnu.org/licenses/rms-why-gplv3.html
+    http://publicbt.com/
+    https://hsivonen.fi/Unicode.pdf
+    http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
+    http://www.cl.cam.ac.uk/~mgk25/metric-typo/
+    http://www.cl.cam.ac.uk/~mgk25/iso-paper.html
+    https://en.wikipedia.org/wiki/ISO_216
+    https://en.wikipedia.org/wiki/Vorbis
+    http://www.matroska.org/technical/guides/faq/index.html
+    https://en.wikipedia.org/wiki/Probability_mass_function
+    https://en.wikipedia.org/wiki/Cumulative_distribution_function
+    http://humpy77.deviantart.com/journal/Frame-Delay-Times-for-Animated-GIFs-214150546
+    http://wiki.hydrogenaudio.org/index.php?title=LAME
+    http://www.torrent-invites.com/showthread.php?t=237795&p=1721708&viewfull=1#post1721708
+    http://www.onemusicapi.com/blog/2013/06/12/better-discogs-searching/
+    http://www.discogs.com/help/api
+    http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
+    http://tools.ietf.org/html/rfc3986
+    http://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid/13500078#13500078
+    http://nakedsecurity.sophos.com/2011/02/20/ssds-prove-difficult-to-securely-erase/
+    http://www.fileformat.info/info/unicode/category/index.htm
+    https://wiki.freebsd.org/IdeasPage
+    http://lame.sourceforge.net/tech-FAQ.txt
+    http://www.unicode.org/versions/Unicode6.2.0/ch02.pdf
+    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Predefined_Core_Objects
+    http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
+    http://developers.whatwg.org/introduction.html
+    http://www.internoetics.com/2012/07/18/retrieve-images-from-the-depreciated-google-images-api/
+    http://www.mnot.net/cache_docs/
+    http://www.imperialviolet.org/2012/07/19/hope9talk.html
+    http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-kbd-element
+    https://tech.dropbox.com/2012/10/caching-in-theory-and-practice/
+    http://calendar.perfplanet.com/2011/why-inlining-everything-is-not-the-answer/
+    http://www.igvita.com/2012/12/18/deploying-new-image-formats-on-the-web/
+    http://www.igvita.com/posa/high-performance-networking-in-google-chrome/
+    https://developers.google.com/speed/docs/insights/rules
+    http://dev.chromium.org/spdy/spdy-whitepaper
+    http://www.igvita.com/2012/07/19/latency-the-new-web-performance-bottleneck/
+    https://developers.google.com/speed/articles/
+    http://www.w3.org/TR/html5/text-level-semantics.html#the-i-element
+    https://github.com/csswizardry/CSS-Guidelines/blob/master/CSS%20Guidelines.md
+    http://mathiasbynens.be/notes/inline-vs-separate-file
+    http://snook.ca/archives/html_and_css/font-size-with-rem
+    http://nicolasgallagher.com/micro-clearfix-hack/
+    http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
+    http://quirksmode.org/css/css2/tables.html
+    http://www.ecma-international.org/ecma-262/5.1/
+    https://tools.ietf.org/rfc/rfc1945.txt
+    http://www.ietf.org/rfc/rfc1738.txt
+    https://rawgithub.com/whatwg/html-differences/master/Overview.html
+    http://stackoverflow.com/questions/2526033/why-specify-charset-utf-8-in-your-css-file
+    https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4
+    https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag
+    http://youmightnotneedjquery.com/
+    http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/
+    http://www.html5rocks.com/en/tutorials/webaudio/intro/
+    http://wiki.whatwg.org/wiki/HTML_vs._XHTML
+    http://www.w3.org/TR/xhtml1/diffs.html
+    https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
+    http://www.kryptonite-dove.com/blog/load-json-file-locally-using-pure-javascript
+    http://stackoverflow.com/questions/336859/var-functionname-function-vs-function-functionname/338053#338053
+    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
+    http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
+    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
+    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
+    http://nodejs.org/api/repl.html
+    https://brendaneich.com/2012/10/harmony-of-dreams-come-true/
+    http://rosettacode.org/wiki/Averages/Median#JavaScript
+    http://rosettacode.org/wiki/Binary_search#JavaScript
+
+    #shell
+    https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
+    http://superuser.com/questions/578321/how-to-flip-a-video-180-vertical-upside-down-with-ffmpeg/578329#578329
+    http://www.brendangregg.com/dtrace.html
+    http://pubs.opengroup.org/onlinepubs/009696799/utilities/echo.html
+    http://unix.stackexchange.com/questions/78990/what-are-the-readline-word-separators
+    http://code.google.com/p/gnups/wiki/WhypsSucks
+    http://www.imagemagick.org/Usage/resize/
+    http://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo
+    http://www.catonmat.net/blog/set-operations-in-unix-shell/
+    http://briancarper.net/blog/248/
+    http://code.dogmap.org/lintsh/
+    http://psychiatry.igm.jhmi.edu/wiki/index.php/AWK
+    http://mywiki.wooledge.org/Bashism
+    http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
+    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html
+    http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html
+    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
+    http://www.leancrew.com/all-this/2012/11/ssh-tunneling-redux/
+    http://www.drbunsen.org/explorations-in-unix.html
+    http://unix.stackexchange.com/questions/74197/how-to-unset-range-of-array-in-bash
+    http://ridiculousfish.com/shell/faq.html
+    http://ridiculousfish.com/shell/user_doc/html/
+    http://victorquinn.com/blog/2011/06/20/tmux/
+    http://mywiki.wooledge.org/NullGlob
+    http://www.veen.com/jeff/archives/000573.html
+    http://zagaeski.devio.us/0006.html
+    http://www.gnu.org/software/wget/manual/wget.html
+    http://www.etalabs.net/sh_tricks.html
+    http://mywiki.wooledge.org/BashPitfalls
+    http://mywiki.wooledge.org/BashGuide/Practices
+    http://blog.macromates.com/2008/working-with-history-in-bash/
+    http://blog.macromates.com/2005/shell-variables/
+    http://matt.might.net/articles/sculpting-text/
+    http://matt.might.net/articles/ssh-hacks/
+    http://www.grymoire.com/Unix/Sed.html
+    http://www.greenwoodsoftware.com/less/faq.html
+    http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html
+    http://www.opengroup.org/austin/papers/posix_faq.html
+    https://wiki.ubuntu.com/DashAsBinSh
+    http://tiswww.case.edu/php/chet/bash/FAQ
+    http://tldp.org/LDP/abs/html/bashver4.html
+    http://ss64.com/bash/syntax-inputrc.html
+    http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=blob_plain;f=README
+    http://www.catonmat.net/blog/the-definitive-guide-to-bash-command-line-history/
+    http://www.catonmat.net/blog/bash-one-liners-explained-part-three/
+    http://ss64.com/bash/shopt.html
+    http://mywiki.wooledge.org/Quotes
+    http://www.cybertux.nl/diversen/gnuplot/basic_gnuplot.html
+    http://www.pantz.org/software/cron/croninfo.html
+    http://www.norbauer.com/rails-consulting/notes/ls-colors-and-terminal-app.html
+    http://www.in-ulm.de/~mascheck/various/echo+printf/
+    http://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html
+    http://ffmpeg.org/faq.html
+    http://blog.superuser.com/2011/11/07/video-conversion-done-right-codecs-and-software/
+    http://blog.superuser.com/2012/02/24/ffmpeg-the-ultimate-video-and-audio-manipulation-tool/
+    http://wiki.bluewallmedia.com/index.php?title=FFMPEG_command_strings
+    http://www.in-ulm.de/~mascheck/various/argmax/
+    http://yash.sourceforge.jp/doc/posix.html
+    http://www.gnu.org/software/coreutils/faq/coreutils-faq.html
+    http://partmaps.org/era/unix/shell.html
+    http://unix.stackexchange.com/questions/78408/which-is-more-idiomatic-in-a-bash-script-true-or
+    http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html
+    http://zsh.sourceforge.net/FAQ/zshfaq02.html#l9
+    http://apple.stackexchange.com/questions/24261
+    http://en.wikipedia.org/wiki/Caret_notation
+    http://mywiki.wooledge.org/BashFAQ/026
+    http://unix.stackexchange.com/questions/86270/how-do-you-use-the-command-coproc-in-bash
+    https://raw.github.com/lhunath/scripts/master/bash/bashlib/bashlib
+    http://mywiki.wooledge.org/BashFAQ/035
+    http://mywiki.wooledge.org/BashFAQ/031
+    http://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html
+    http://en.wikipedia.org/wiki/Unix_signal
+    http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250
+    http://www.gnu.org/software/gawk/manual/gawk.html
+    http://xmlstar.sourceforge.net/doc/xmlstarlet.txt
+    http://mywiki.wooledge.org/DotFiles
+    https://rvm.io/support/faq#what-shell-login-means-bash-l
+    https://github.com/janmoesen/tilde/blob/master/.wgetrc
+    http://stackoverflow.com/questions/6973088/longest-common-prefix-of-two-strings-in-bash
+    http://unix.stackexchange.com/questions/87445/changing-column-separators-in-a-file/87447#87447
+    http://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
+    http://superuser.com/questions/218340/how-to-generate-a-valid-random-mac-address-with-bash-shell
+    http://unix.stackexchange.com/questions/44836/when-sh-is-a-symlink-to-bash-or-dash-bash-limits-itself-to-posix-compliance-so/48925#48925
+    http://www.unix.org/whitepapers/shdiffs.html
+    http://pubs.opengroup.org/onlinepubs/009695399/utilities/awk.html
+    http://unix.stackexchange.com/questions/73750/difference-between-function-foo-and-foo/73854#73854
+    https://trac.ffmpeg.org/wiki/GuidelinesHighQualityAudio
+    http://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html
+    http://wiki.bash-hackers.org/scripting/bashchanges
+    http://tiswww.case.edu/php/chet/bash/CHANGES
+    http://wiki.bash-hackers.org/bash4
+    http://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES?id=bash-4.3-beta2
+    http://tiswww.case.edu/php/chet/bash/COMPAT
+    http://api.stackexchange.com/2.1/users/22565/answers?pagesize=100&order=desc&sort=activity&site=unix&filter=!bFN2MqFu-JdrhV
+    http://unix.stackexchange.com/a/90884
+    http://stackoverflow.com/questions/4336035/performance-profiling-tools-for-shell-scripts
+    http://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html
+    http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS
+    http://en.wikipedia.org/wiki/ANSI_escape_code
+    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/stty.html
+    http://www.gnu.org/software/coreutils/manual/coreutils.html
+    http://mywiki.wooledge.org/BashFAQ/071
+    http://mywiki.wooledge.org/BashFAQ/085
+    http://cfajohnson.com/shell/articles/dynamically-loadable/
+    http://mywiki.wooledge.org/BashFAQ/091
+    http://mywiki.wooledge.org/BashFAQ/105
+    http://unix.stackexchange.com/questions/76049/what-is-the-difference-between-sort-u-and-sort-uniq
+    http://www.pdflabs.com/docs/pdftk-cli-examples/
+    http://www.itbroadcastanddigitalcinema.com/ffmpeg_howto.html
+    https://trac.ffmpeg.org/wiki/EncodeforYouTube
+    http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html
+    http://www.johndcook.com/blog/2010/07/14/bc-math-library/
+    http://www.pement.org/sed/sedfaq.txt
+    http://www.pement.org/awk/awkuse.txt
+    http://www.pement.org/awk/awktail.txt
+    http://explainshell.com/explain?cmd=iptables%20-A%20INPUT%20-i%20eth0%20-s%20ip-to-block%20-j%20DROP
+    http://stedolan.github.io/jq/tutorial/
+    http://stedolan.github.io/jq/manual/
+    http://www.vt100.net/docs/vt100-ug/chapter3.html#ED
+    http://stackoverflow.com/questions/12871090/how-to-calculate-cpu-utilization-of-a-process-all-its-child-processes-in-linux
+    http://www.manpages.info/linux/proc.5.html
+    https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files#samecodec
+    http://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options
+    http://stackoverflow.com/questions/21096478/overwrite-executing-bash-script-files/21100710#21100710
+    https://github.com/search?l=bash&o=desc&q=stars%3A%3E1&s=stars&type=Repositories
+    https://github.com/WilliamHackmore/linuxgems/blob/master/cheat_sheet.org.sh
+    https://raw2.github.com/jclem/gifify/master/gifify.sh
+    http://blog.room208.org/post/48793543478
+    http://www.imagemagick.org/script/command-line-options.php?#layers
+    http://www.brendangregg.com/DTrace/dtrace_oneliners.txt
+    http://stackoverflow.com/questions/5296667/pdftk-compression-option
+    http://stackoverflow.com/questions/15376562/cant-write-to-named-pipe
+    http://s3tools.org/s3cmd
+    http://unix.stackexchange.com/questions/18212/bash-history-ignoredups-and-erasedups-setting-conflict-with-common-history/18443#18443
+    http://en.wikipedia.org/wiki/Setuid
+    http://www.samiam.org/awk/annoyances.html
+    http://en.wikipedia.org/wiki/AWK#Versions_and_implementations
+    http://stackoverflow.com/questions/296536/urlencode-from-a-bash-script
+    https://github.com/search?q=language%3Ashell
+    http://article.gmane.org/gmane.comp.lang.smalltalk.gnu.general/7873
+    http://www.catonmat.net/download/bash-redirections-cheat-sheet.txt
+    http://sed.sourceforge.net/
+    https://github.com/rupa/z/blob/master/z.sh
+    http://stackoverflow.com/questions/11337041/force-line-buffering-of-stdout-when-piping-to-tee
+    http://expect.sourceforge.net/example/unbuffer.man.html
+    http://shebang.brandonmintern.com/tips-for-remote-unix-work-ssh-screen-and-vnc/
+    http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html
+    http://www.imagemagick.org/Usage/filter/
+    http://pubs.opengroup.org/onlinepubs/009695399/utilities/dd.html
+    http://www.gnu.org/software/gawk/manual/gawk.html#Integer-Programming
+    https://gist.github.com/BluntBlade/7891642
+    http://zsh.sourceforge.net/releases.html
+
+## ruby
+
+    Array.new(2) # [nil, nil]
+    Array.new(2, 0) # [0, 0]
+    Array.new(2, Array.new(2)) # [[nil, nil], [nil, nil]]
+    Array.new(2, Hash.new) # [{}, {}]
+    n = [0, 2]; [7, 8, 9].values_at(*n) # [7, 9]
+    %w(a b).repeated_permutation(2).map(&:join) # ["aa", "ab", "ba", "bb"]
+    [1, 2].repeated_combination(2).to_a # [[1, 1], [1, 2], [2, 2]]
+    [[1, 2], [3, 4], [5, 6]].transpose[0] # [1, 3, 5]
+    [1, 2] & [1] # [1]
+    [3, 1] | [1, 2] # [3, 1, 2]
+    [1, 2, 3, 4, 5].each_slice(2).to_a # [[1, 2], [3, 4], [5]]
+    a = [1, 2, 3, 4, 5]; a.shift(2); a # [3, 4, 5]
+    a = [2, 3]; a.unshift(1); a # [1, 2, 3]
+    [1, nil].compact # [1]
+    [[0, 0], [0, 1], [1, 2]].uniq { |e| e[0] } # [[0, 0], [1, 2]]
+    [1, 2] * 2 # [1, 2, 1, 2]
+    %w(a b) * ", " # "a, b"
+    a = [1, 2, 3, 4]; a.reduce(:+).to_f / a.size # 2.5
+    a = [1, 2, 3]; a.delete_at(1); a # [1, 3]
+    [[1], [2, 3]].flatten # [1, 2, 3]
+    %w(aa bb).grep(/^a/) # ["aa"]
+    [1.0, "two", 3].grep(Fixnum) # [3]
+    [1, 2].map(&:to_s) # ["1", "2"]
+    "1 2".split.map(&:to_i) # [1, 2]
+    [" aa", "bb", " cc"].partition { |x| x =~ /^ / } # [[" aa", " cc"], ["bb"]]
+    ["11 a", "2 b"].sort_by { |x| x[/^\d+/].to_i }
+    [1, 2, 3, 4, 5].last(2) # [4, 5]
+    require "pp"; pp hash # pretty print a hash
+    {a: 1}.key(1) # :a
+    {a: 1}.invert # {1=>:a}
+    Hash[1, 2, 3, 4] # {1=>2, 3=>4}
+    a = [1, 2, 3, 4]; Hash[*a] # {1=>2, 3=>4}
+    Hash[{a: 11, b: 1, c: 2}.sort_by { |k, v| v.to_i }] # {:b=>1, :c=>2, :a=>11}
+    {:a=>1}.merge({:b=>2}) # {:a=>1, :b=>2}
+    h = Hash.new(0); h[:a] += 5; h # {:a=>5}
+    h = Hash.new { |x, k| x[k] = [] }; h[:a] << 1; h[:a] << 2; h # {:a=>[1, 2]}
+    h = Hash.new(0); [2, 2, 3, 4, 4].each { |v| h[v] += 1 }; h # {2=>2, 3=>1, 4=>2}
+    h = {}; %w(aa bb).each { |v| (h["k"] ||= []) << v }; h # {"k"=>["aa", "bb"]}
+    h = {}; %w(aa bb).each { |v| (h["k"] ||= []) << v }; h # {"k"=>"aabb"}
+    {"x"=>1,"y"=>2}.flatten # ["x", 1, "y", 2]
+    {"x":1}.has_value?(1) # true
+    {"x"=>1,"y"=>2,"z"=>2}.assoc(2) # nil
+    {"x"=>1,"y"=>2,"z"=>2}.rassoc(2) # ["y", 2]
+    Hash[[:x, :y].zip([1, 2])] # {:x=>1, :y=>2}
+    "\u{1234}".size # 1 in 1.9 and 2 in 1.8
+    ["1234".hex].pack("U").scan(/./mu).size # 1 in both 1.9 and 1.8
+    "z".ord.to_s(16) # "7a" (1.9)
+    "%x" % "z".unpack("U*")[0] # "7a" (1.8)
+    "abb".index("b") # 1
+    "abb".rindex("b") # 2
+    "xxy".count("x") # 2
+    "aa".rjust(4) # "  aa"
+    "aa".center(5, "-") # "-aa--"
+    s = "abb"; s["bb"] = "c"; s # "ac"
+    s = "ab"; s["cd"] # nil
+    "az".next # "ba"
+    "a\t".split("\t") # ["a"]
+    "a\t".split("\t", 2) # ["a", ""]
+    "xaxbxx".split("x") # ["", "a", "b"]
+    "xaxbxx".scan(/(?<=(?:x|^))[^x]*/) # ["", "a", "b", "", ""]
+    "\ta\n  b".split # ["a", "b"]
+    "a\u{5b57}".codepoints.to_a # [97, 23383]
+    "abc".tr("ac", "AC") # "AbC"
+    "a\nb\n".lines.map(&:chomp) # ["a", "b"]
+    "<b>aa</b>"[/<b>(.*?)<\/b>/, 1] # "aa"
+    [1, 2, 3, 4, 5].take(2) # [1, 2]
+    [1, 2, 3, 4, 5].drop(2) # [3, 4, 5]
+    [2, 3, 4].reduce(:+) # 9
+    [2, 3, 4].reduce(:*) # 24
+    [1, 3].all? { |x| x.odd? } # true
+    enum = [1, 2].each; p enum.next # 1
+    enum = Enumerator.new { |x| x << 1 }; p enum.next # 1
+    enum = "x".enum_for(:each_byte); enum.first # 120
+    p [1, 2].cycle.take(5) # [1, 2, 1, 2, 1]
+    3.times.map { |n| "file_#{n}" } # ["file_0", "file_1", "file_2"]
+    %w(x y z).select.with_index { |e, i| i.even? } # ["x", "z"]
+    (1..6).group_by { |i| i % 3 } # {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
+    (0.2..0.6).step(0.2).to_a # [0.2, 0.4, 0.6]
+    ["--", "---"].reduce(0) { |sum, x| sum + x.length } # 5
+    Array.new(6).map { [*"a".."z", *"0".."9"].sample }.join
+    "%3i" % 9 # "  9"
+    "%03i" % 9 # "009"
+    "%-3s" % "a" # "  a"
+    "%02x" % 10 # "0a"
+    "%b" % 6 # 110
+    Math.log(Math::E**3) # 3.0
+    -3.abs # 3
+    [1, 2].min # 1
+    (1..6).reduce(:*) # 720
+    a.reduce(:+).to_f / a.size # arithmetic mean
+    a.reduce(:*).to_f ** (1.0 / a.size) # geometric mean
+    a.size.to_f / a.map { |n| 1.0 / n }.reduce(:+) # harmonic mean
+    (a.map { |n| n ** 2 }.reduce(:+).to_f / a.size) ** 0.5 # RMS
+    (125 ** (1.0 / 3)).round # 5 (cube root)
+    Integer::natural.select { |x| x**2 % 5 == 0 }.take(10).reduce(:+) # 275
+    File.write("file", "text\n") # 1.9.3 and later
+    IO.open("file", "w") { |f| f.puts("text") } # 1.8
+    File.open("file", "a") { |f| f.puts("text") } # append
+    Dir.home # an alternative to ENV["HOME"] in 1.9 and later
+    FileUtils.rm(Dir["*.html"])
+    FileUtils.mkdir_p("a/b")
+    File.basename("/folder/file.txt", ".txt") # "file"
+    File.basename("file.txt", ".*") # "file"
+    IO.open("utf16.txt", "r:UTF-16:UTF-8")
+    Dir["*.txt"].map { |f| File.size(f) }.reduce(:+)
+    Dir["**/*.txt"].each { |f| IO.write(f, IO.read(f).gsub("aa", "bb")) }
+    Dir.chdir(File.dirname(__FILE__)) # cd to the directory of a script
+    Dir.chdir(__dir__) # cd to the directory of a script (2.0 and later)
+    File.mtime(".").strftime("%F")
+    require "pathname"; Pathname.new(".").realpath
+    puts Dir["*"].sort_by { |f| File.mtime(f) }[0]
+    File.open("file").gets # first line
+    rand(6) + 1 # random number between 1 and 6
+    [1, 2, 3].sample(2) # two random elements
+    rand 2 # 0 or 1
+    4.times.map { rand(1000) }
+    ("a"..."c") === "b" # true
+    ("a".."c").cover?("bb") # true
+    ("a".."e").step(2).to_a # ["a", "c", "e"]
+    [*0..2] # [0, 1, 2]
+    "<b>aa</b>" =~ /(?<=<b>)(.*)(?=<\/b>)/; $& # "aa"
+    "aabc" =~ /b/; $` # "aa"
+    /b/.match("aabc").pre_match # "aa"
+    "aa,bb,cc".gsub(/(?<=,|^)(.*?)(?=,|$)/, "a") # "a,a,a"
+    "some string".gsub(/\b\w/) { $&.upcase } # "Some String"
+    Regexp.new(Regexp.escape("pattern"), "i") # /pattern/i
+    "xyz".gsub(/[xyz]/, "x" => 1, "z" => 3) # "1y3"
+    system("echo", "a")
+    IO.popen(["echo", "a"]).read
+    IO.popen("tr y z", "w") { |io| io.puts "xyz" }
+    IO.popen(["tr", "y", "z"], "w") { |io| io.puts "xyz" }
+    IO.popen("tr y z", "r+") { |io| io.puts("xyz"); io.close_write; io.read }
+    Time.now.to_i # seconds since epoch
+    "%.3f" % Time.now # time with milliseconds
+    Time.at(123467890)
+    require "date"; Date.parse("2013-09-07").month # 9
+    require "time"; Time.parse("2013-01-13 15:55:13 +0200")
+    Date.new(2012).leap? # true
+    Nokogiri.XML("<a><b>c</b></a>").css("a b").to_s # "<b>c</b>"
+    x = Nokogiri.XML("<a>1</a><b>2</b>"); x.at_css("a").content = "3"; x.to_xml
+    require "json"; JSON.load('{"a":[1,2],"b":"c"}')
+    JSON.parse("\\u003Cp\\u003E") # "<p>"
+    JSON.pretty_generate(json) # pretty print JSON
+    require "csv"; CSV.read("input.csv").map { |row| row.join("\t") }.join("\n")
+    CSV.parse("1,2\n3,4").map { |row| row.to_csv(:col_sep => ";") }.join
+    IO.readlines("input.tsv").map { |l| l.split("\t").values_at(2, 3) }
+    CSV.parse("field1,field2\n1,a\n2,b\n", headers: true)[0]["field2"] # "a"
+    "a\nb\n".lines # ["a\n", "b\n"] in 2.0 and an enumerator in older versions
+    %i(a b) # [:a, :b] in 2.0
+    __dir__ # a shorter alternative to File.dirname(__FILE__) in 2.0
+    [1, 2].lazy.cycle.map { |x| x * 10 }.take(3).to_a # [10, 20, 10] in 2.0
+    "a\nb\rc\v".gsub(/\R/, "") # "abc" (\R is linebreak in 2.0)
+    raise ArgumentError, "Invalid argument"
+    raise IndexError, "Out of range"
+    $: # $LOAD_PATH
+    abort "error" # an alternative to STDERR.puts "error"; exit 1
+    input = ARGV[0] || STDIN.read
+    input = STDIN.read if STDIN.stat.size > 0
+    STDIN.read.sub(/\A\n*/m, "").sub(/\n*\Z/m, "\n")
+    STDIN.read.gsub(/[^\0-\177]/, "")
+    puts "\033[1mbold\033[mnormal"
+    p x # same as puts x.inspect
+    Symbol.all_symbols
+    trap("EXIT") { exit 0 }
+    require "sqlite3"; SQLite3.Database.new("file.db").execute("SELECT * FROM data")
+    require "securerandom"; SecureRandom.uuid
+    [8, 4, 4, 4, 14].map { |n| "%#{n}x" % rand(16**n) }.join("-")
+    __END__ # use the rest of the file for the DATA IO object
+    __FILE__ == $0 # test if a script is run directly
+    n = 0; readlines.sort_by { |l| n += 1; [l.split(" ")[0], n] } # stable sort_by
+    Encoding.list # list encoding names
+    IO.readlines("file.tsv").sort_by { |l| l.split("\t")[2] }
+    Dir["*"].sort_by { |f| File.mtime(f) }
+    require "grooveshark"; Grooveshark::Client.new.search_songs("Artist - Title")
+    File.exists?(f) ? IO.readlines(f).map(&:chomp) : []
+    Kernel.is_a?(Module) # true
+    "a".encoding.name # "UTF-8"
+    a = [1, 2, 3, 2]; a.max_by { |x| a.count(x) } # 2
+    a = [8, 9, 8]; h = Hash.new(0); a.each { |x| h[x] += 1}; h # {8=>2, 9=>1}
+    [1, 2].flat_map { |e| [e, -e] } # [1, -1, 2, -2]
+    [1, 1, 2].count(1) # 2
+    [1, 1, 2].count{ |x| x % 2 == 0} # 1
+    [1, 2].cycle(2).to_a # [1, 2, 1, 2]
+    [1, 2, 3, 4].drop_while { |x| x <= 2 } # [3, 4]
+    (1..4).each_cons(2).to_a # [[1, 2], [2, 3], [3, 4]]
+    (1..4).each_cons(3).to_a # [[1, 2, 3], [2, 3, 4]]
+    require "prime"; Prime.entries(10) # [2, 3, 5, 7]
+    (1..10).find_index(5) # 4
+    (1..10).grep(4..6) # [4, 5, 6]
+    (1..6).group_by { |x| x % 3 } # {1=>[1, 4], 2=>[2, 5], 0=>[3, 6]}
+    IO.constants.include?(:SEEK_SET) # true
+    (1..9).find_all { |x| x % 3 == 0 } # [3, 6, 9]
+    (1..5).take_while { |i| i <= 3 } # [1, 2, 3]
+    %w(aa bb).each_with_index.to_h # {"aa"=>0, "bb"=>1}
+    [1,2].to_enum.first # 1

File osx/lri.me/osx.txt

+#priorized
+`d=~/Library/KeyBindings;mkdir $d;echo '{"~x"=(selectParagraph:,cut:);}'>$d/DefaultKeyBinding.dict` makes option-X cut a line
+`brew install bash;echo /usr/local/bin/bash|sudo tee -a /etc/shells;chsh -s /usr/local/bin/bash` installs bash 4
+`defaults write -g AppleFontSmoothing -int 1` makes OS X use a lighter text rendering style
+`defaults write -g NSUserKeyEquivalents -dict-add 'Select Previous Tab' @j 'Select Next Tab' @k` makes command-J and command-K change tabs
+you can make sudo not require a password by running `sudo visudo` and changing `%admin ALL=(ALL) ALL` to `%admin ALL=(ALL) NOPASSWD: ALL`
+`COPYFILE_DISABLE= tar -cf dir.tar dir` creates a tar archive with no AppleDouble files
+`zip dir.zip -r dir` creates a zip archive with no __MACOSX directory
+`echo setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin|sudo tee -a /etc/launchd.conf` adds /usr/local/bin to PATH after restarting
+`brew install duti;echo net.sourceforge.skim-app.skim .pdf all>~/.duti;duti ~/.duti` sets Skim as the default application for PDF files
+`echo org.gnu.Emacs public.plain-text all>>~/.duti;duti `~/.duti` sets Emacs as the default application for text files with no extension
+`echo org.gnu.Emacs public.unix-executable all>>~/.duti;duti ~/.duti` sets Emacs as the default application for executable scripts
+`osascript -e 'set text item delimiters to linefeed' -e 'tell app "Safari" to (URL of tabs of window 1) as text'` lists the URLs of tabs
+you can see what files would be copied by an installer by pressing command-I in an installer window
+`brew tap homebrew/dupes;brew install coreutils findutils gawk gnu-sed gnu-tar wget homebrew/dupes/grep` installs GNU utilities
+`brew tap phinze/cask;brew install brew-cask;brew cask install sequential` installs Sequential
+`find . \( -iname \*.rar -o -iname \*.zip \) -execdir unar -p '' {} +` extracts archives and skips archives that require a password
+`x() { for f;do case $f in *.dmg)hdiutil attach "$f";;*)unar "$f";;esac;done; }` mounts disk images and extracts archives
+`defaults write -g NSScrollAnimationEnabled -bool false` disables smooth scrolling
+`defaults write -g NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool false` makes TextEdit and Preview not show an open dialog on launch
+`defaults write com.apple.finder ShowSidebar -bool false` makes Finder hide the sidebar by default
+`for x in 'On -float 999999999' 'Off -float 0';do defaults write -g NSTextInsertionPointBlinkPeriod$x;done` disables blinking the caret
+`defaults write -g NSAllowContinuousSpellChecking -bool false` disables spell checking in most text views
+`syslog` is an alternative to `cat /var/log/system.log` and `syslog -w` is an alternative to `tail -f /var/log/system.log`
+`open -jga Mail` opens Mail hidden and in the background
+`launchctl unload /System/Library/LaunchAgents/com.apple.Finder.plist` quits Finder
+`launchctl limit` is an alternative to `ulimit -a;ulimit -Ha`
+`sudo launchctl limit maxfiles 10000` changes the soft and hard limits for the number of open files temporarily for new processes
+`echo limit maxfiles 10000|sudo tee -a /etc/launchd.conf` changes the limits for the number of open files permanently after restarting
+`mdimport -A` shows a list of the kMD attribute identifiers
+`mdfind '"search phrase"'` searches for an exact phrase
+`mdfind kMDItemContentType=com.apple.application-bundle` searches for applications
+`mdfind kMDItemContentTypeTree=public.movie` searches for videos
+`mdfind 'kMDItemFSContentChangeDate>$time.now(-86400)' -onlyin ~/Library/Caches/Metadata/Safari/History` shows recent Safari history items
+`shis() { mdfind "$*" -onlyin ~/Library/Caches/Metadata/Safari/History|xargs mdls -n kMDItemURL|cut -d\" -f2; }` searches for history items
+`mdls -n kMDItemURL $(mdfind kMDItemURL=*stackoverflow.com* -onlyin ~/Library/Caches/Metadata/Safari/History)` lists Stack Overflow URLs
+`mdfind 'kMDItemDateAdded>$time.today(-7)'` shows files added in the last week
+`mdfind 'kMDItemAuthors="Artist Name"' -onlyin ~/Music` searches by artist
+`mdfind 'kMDItemContentType=*' -onlyin .` lists all indexed files
+`mdfind 'kMDItemFSSize>1e8'` finds files over 100 MB
+`touch /tmp/a.mkv;mdls -n kMDItemContentTypeTree /tmp/a.mkv` shows the UTI and parent UTIs for the mkv extension
+`mdfind -0 -onlyin ~/Music 'kMDItemFSName=*.mp3&&kMDItemAudioBitRate<=192000'|xargs -0 mdls -n kMDItemAlbum|sort -u` finds low quality albums
+`sudo mdutil -E /` erases the Spotlight index on the startup volume and `sudo mdutil -Ea` erases the Spotlight indexes on all volumes
+`mdfind com_apple_backup_excludeItem=com.apple.backupd` finds files excluded from Time Machine backups
+you can see if files have been opened before by running `mdls -n kMDItemFSName -n kMDItemLastUsedDate *`
+`mdls -n kMDItemFSName -n kMDItemWhereFroms *` shows the URLs that files were downloaded from
+`mdfind -s example` is an alternative to `mdfind "$(PlistBuddy -c 'Print RawQuery' ~/Library/Saved\ Searches/example.savedSearch)"`
+`mdfind kMDItemUserTags=*` finds files with tags
+`sudo tmutil disablelocal` disables local Time Machine snapshots
+`tmutil status` shows if a backup is in progress
+`sudo ln -s "$(tmutil machinedirectory)" /tm;sudo chflags -h hidden /tm` creates a symlink for the machine directory
+`tmutil compare ~/Notes/ "$(tmutil machinedirectory)"/Latest/*/Users/$USER/Notes/` shows changes to ~/Notes/ since the last backup
+`tmutil calculatedrift "$(tmutil machinedirectory)"` shows the size of changes between backups
+`screencapture -ic` is an alternative to control-shift-command-4
+`screencapture -l$(osascript -e 'tell app "Safari" to id of window 1') a.png` saves a screenshot of the frontmost Safari window
+`security find-internet-password -s accounts.google.com -w` shows a Google account password
+`find ~/Library/Scripts -name \*.scpt|parallel osadecompile {}\>{.}.applescript\;rm {}` replaces .scpt files with .applescript files
+`quit() { osascript -e 'on run {a}' -e 'quit app a' -e end -- "$1"; }` quits an application
+`osascript -e 'tell app "Safari" to source of document 1'` shows the source of the current tab
+`osascript -e 'tell app "Safari" to do JavaScript "document.body.innerHTML" in document 1'` shows the generated source of the current tab
+`osascript -e 'tell app "iTunes" to tell current track to artist&" - "&name'` shows the artist and title of the current track
+`osascript -e 'tell app "System Events" to name of processes whose background only is false'` lists open applications
+`osascript -e 'display notification "text" with title "title" subtitle "subtitle"'` is an alternative to terminal-notifier in 10.9 and later
+`find . -Btime -1` or `mdfind 'kMDItemFSCreationDate>$time.now(-86400)' -onlyin .` finds files created in the last 24 hours
+`mdfind 'kMDItemFSCreationDate>$time.iso(2014-03-16T01:03:08Z)' -onlyin .` is an alternative to `TZ=UTC0 find . -newerBt '2014-03-16 01:03:08'`
+`find . -acl` finds files with ACLs and `find . -xattrname com.apple.ResourceFork` finds files with resource forks
+`find . -flags +uchg` finds locked files
+`xattr -dr com.apple.quarantine ~/Downloads` unquarantines files
+`xattr -cr .` removes extended attributes for all files in the directory tree
+`ls -l@eO` lists extended attributes, ACLs, and file flags
+`ls -lU` shows creation times in place of modification times
+`cat file/..namedfork/rsrc` shows the resource fork of a file
+`>file/..namedfork/rsrc` or `xattr -d com.apple.ResourceFork file` deletes a resource fork
+`rsync -E` preserves extended attributes, ACLs, file flags, and resource forks
+`chmod -RN .` removes ACLs recursively
+`find . -xattrname com.apple.quarantine` finds quarantined files
+`touch -m -t $(stat -f %SB -t %Y%m%d%H%M a) a` or `SetFile -m "$(GetFileInfo -d file)" a` sets modification time to creation time
+`find . -name ._\* -delete` deletes ._ files and `dot_clean .` deletes ._ files after converting the metadata stored in them to native formats
+`diskutil eject WD` ejects a disk and `diskutil mountDisk WD` mounts all volumes on a disk
+`diskutil mount Recovery\ HD;hdiutil mount /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg` mounts the recovery partition
+`mkdir /tmp/efi;sudo mount -t msdos /dev/disk0s1 /tmp/efi` mounts the EFI partition
+`osascript -e 'tell app "Finder" to eject'` ejects disks
+`LC_CTYPE=UTF-8 pbcopy` and `LC_CTYPE=UTF-8 pbpaste` preserve non-ASCII characters when the locale variables are unset like in Automator
+`pbcopy<file` copies the contents of a file
+`hdiutil attach file.dmg;sudo installer -pkg /Volumes/Volume/file.pkg -target /` mounts a disk image and installs a package
+`sudo repair_packages --repair --standard-pkgs` is an alternative to repairing permissions from Disk Utility
+`sudo repair_packages --list-standard-pkgs` lists the packages that are checked when verifying or repairing permissions
+`pmset -g assertions` shows if some processes have made power assertions that prevent idle sleep or display sleep
+`pmset -g log` shows a log of power management events
+`pmset sleepnow` puts a Mac to sleep
+`pmset displaysleepnow` puts displays to sleep in 10.9 and later
+`osascript -e 'tell app "System Events" to restart'` restarts and `osascript -e 'tell app "System Events" to log out'` logs out
+`pmset noidle` or `caffeinate` prevents idle sleep
+`textutil -convert html *.rtf` converts rtf to html and `textutil -convert txt *.doc` converts doc to txt
+`pandoc file.md|textutil -inputencoding UTF-8 -format html -convert rtf -stdin -stdout|pbcopy` copies a Markdown file as rich text
+`sudo codesign -fs - /Applications/Chess.app/` replaces the code signature with an ad-hoc signature and disables sandboxing
+`find ~/Library/Containers/com.apple.TextEdit -type f` finds files in TextEdit's sandbox container
+`strings /Applications/iTunes.app/Contents/MacOS/iTunes|grep -E '^[a-zA-Z0-9.-]{9,99}$'|awk '!a[$0]++'` finds potential defaults keys
+`mdfind kMDItemContentType=public.unix-executable -onlyin /System|xargs strings|grep -iE '^[a-z0-9.-]{9,99}$'` finds potential defaults keys
+`kextstat|grep -v com.apple` lists non-Apple kernel extensions
+`sudo defaults write com.apple.loginwindow LogoutHook ~/.logouthook` enables running ~/.logouthook on logout
+`for f in *.icns;do sips -s format png "$f" -o "${f%icns}png";done` converts icns to png
+`ls -t1 /var/db/receipts` or `cat /Library/Receipts/InstallHistory.plist` shows a list of installed packages
+`lsbom installer.pkg/Contents/Archive.bom` or `lsbom $(pkgutil --bom installer.pkg)` shows what files would be copied by an installer
+`lsbom /var/db/receipts/com.adobe.pkg.FlashPlayer.bom` or `pkgutil --info com.adobe.pkg.FlashPlayer` shows files installed by Flash
+`qlmanage -p $(ls -t)` opens a Quick Look window for files sorted by modification time
+`brew install imagesnap;i=1;while :;do imagesnap $((i++)).png;done` saves images from a webcam
+`bid() { osascript -e 'on run {a}' -e 'id of app a' -e end -- "$*"; }` shows the bundle identifier of an application
+`osascript -e 'text returned of (display dialog "" default answer "")'` shows a text dialog
+`pbpaste|sed 's/$/[[slnc 1000]]/'|say` speaks lines of text with a one second pause between each line
+`defaults write com.apple.finder NSUserKeyEquivalents -dict-add 'Show Package Contents' @\r` makes command-return show package contents
+`defaults delete com.apple.dock persistent-apps;killall Dock` removes all applications from the Dock
+`defaults read ~/Library/Safari/Bookmarks.plist|sed -n 's/^ *URLString = "\(.*\)";/\1/p'` lists the URLs of bookmarks and reading list items
+`$(locate lsregister) -dump` shows the contents of the Launch Services database
+`sudo systemstats` shows for example periods of high I/O and memory activity and what processes have been launched most often
+`sudo powermetrics` shows for example CPU package energy use and processes sorted by a weighted average of package idle wakeups and CPU use
+`lsappinfo listen +becameFrontmost forever` shows when the frontmost application changes
+`lsappinfo launch nofront=true launchandhide=true /Applications/TextEdit.app` is an alternative to `open -gja TextEdit`
+`lsappinfo visibleProcessList|cut -d\" -f4` prints the name of the second frontmost application
+`open $(mdls -name kMDItemWhereFroms ~/Downloads/*.download|grep -o 'http[^"]*')` attempts downloading partially downloaded files again
+`sudo find / -name .localized -delete` disables using localized folder names when the OS language is not English
+`defaults write com.apple.TextEdit AppleAntiAliasingThreshold -int 999` disables antialiasing in TextEdit
+`find ~/Music \( -name \*.pls -o -name \*.m3u \) -delete` deletes playlist files
+`find ~/Music -name \*.flac -o name \*.ogg|parallel ffmpeg -i {} -aq 1 {.}.mp3\;rm {}` converts FLAC and OGG files to V1 MP3
+`ps -eco comm=` lists the names of processes
+`stat -f '%N %z %Sm %SB %Su' *` shows filename, size in bytes, modification time, creation time, and username
+`find . -exec stat -f '%m %N' {} +|sort|tail -n1` finds the newest file
+`find /usr/local/bin ! -lname '../Cellar/*'` finds non-Homebrew binaries
+`brew list --verbose gawk` lists the files installed by the gawk formula
+`brew install emacs --cocoa` installs Emacs.app
+`brew install webkit2png;webkit2png http://www.example\.com` saves a screenshot of a website
+`brew install ntfs-3g` adds support for writing to NTFS drives
+`git clone github\.com/pufuwozu/toggle-osx-shadows.git;cd toggle-osx-shadows;make;./toggle-osx-shadows` disables shadows
+`man -k dtrace` lists dtrace scripts
+`sudo opensnoop` shows opened files, `sudo execsnoop` shows new processes, and `sudo iosnoop` shows IO events
+`sudo iotop` shows processes with the highest IO use and `sudo kill.d` shows signals sent to processes
+control-option-command-2 sorts by kind and control-option-command-5 sorts by modification date in Finder
+control-option-command-6 sorts by size and control-option-command-7 sorts by tags in Finder
+you can change the default column width for column view windows in Finder by dragging a column while holding option
+you can edit tags with the keyboard in Finder by adding a shortcut for the Tags... menu item from System Preferences
+you can change the columns used for new playlists in iTunes by changing the columns in the view for all songs
+shift-command-H opens iTunes Store and command-1 opens the music library in iTunes
+you can find recently played songs in iTunes by pressing command-1 and sorting by last played
+you can move the files of items in iTunes by copying the items in iTunes and pressing option-command-V in Finder
+command-N selects the next item and command-P selects the previous item in the window for editing tags in iTunes
+you can tell iTunes to save the playback position for a file like an audiobook by selecting Get Info > Options > Remember playback position
+command-L shows the current item in the library or on the playlist the item was started from in iTunes
+you can preview a single track from each album on a playlist in iTunes by sorting the playlist by track number
+`tell app "iTunes" to refresh selection` updates the tags of the selected items if the tags have been edited outside iTunes
+you can move focus from the location bar to the first Google search result in Safari by pressing tab or shift-tab one or more times
+you can remove the suggested search phrases from Safari's location bar by selecting Privacy > Prevent search engine from providing suggestions
+you can download files like videos that are not saved by command-S in Safari by focusing the location bar and pressing option-return
+option-command-C opens the JavaScript console and option-command-A opens the resources tab in Safari
+you can add a category for all characters to the sidebar in Character Viewer by selecting Customize List... > Code Tables > Unicode
+option-command-1 hides thumbnails, option-command-2 shows thumbnails, and option-command-6 shows a contact sheet view in Preview
+you can open a URL from Terminal by double-clicking the URL while holding command
+control-F2 or command-? moves focus to the menu bar
+you can change the output volume in smaller increments by pressing the volume keys while holding option and shift
+you can set the output volume to a level between zero bars and one fourth bar by pressing the mute key after setting the volume to zero
+you can add words to a spelling dictionary by adding one word per line to a file in ~/Library/Spelling/ and running `killall AppleSpell`
+you can replace straight quotes with smart quotes in a selection by selecting Substitutions > Smart Quotes from a context menu
+shift-command-3 saves a screenshot of the whole screen and shift-command-4 saves a screenshot of an area
+you can take a screenshot of a window without a shadow by pressing shift-command-4, pressing space, and option-clicking the window
+control-shift-eject puts displays to sleep, option-command-eject puts the computer to sleep, and control-command-eject restarts the computer
+command-F1 toggles mirroring displays
+command-delete selects buttons like Don't Save
+control-' and control-" insert straight quotes even when smart quotes are enabled
+you can disable the notifications about new updates in 10.8 and later by disabling automatic updates completely from System Preferences
+you can open recent files or minimized windows from the application switcher by pressing the down arrow key twice
+`defaults write -g NSAutomaticWindowAnimationsEnabled -bool false` disables the animations for opening and closing windows
+`defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false` disables using iCloud as the default location in save dialogs
+`defaults write -g NSTextShowsControlCharacters -bool true` makes text views show ASCII control characters in caret notation
+`defaults write com.apple.CrashReporter DialogType none` disables crash report dialogs
+`defaults write com.apple.LaunchServices LSQuarantine -bool false` removes the dialogs shown when opening files downloaded from the Internet
+`defaults write com.apple.dashboard mcx-disabled -bool true` disables Dashboard
+`defaults write com.apple.archiveutility dearchive-reveal-after -bool false` disables opening a Finder window after extracting an archive
+installing gnuplot with `brew install gnuplot --with-x` and installing XQuartz makes gnuplot support displaying the output in an X window
+you can enable the root user from Directory Utility.app or by running dsenableroot
+if you accidentally edit /etc/sudoers so that you cannot use sudo, you can enable the root user, run `su root`, and then edit /etc/sudoers
+if Spotlight indexing always stops at some point, try to delete files shown by `sudo lsof|grep mdworker`
+you can take a screenshot on another Mac by enabling remote login and running `ssh username@other_computers_ip;sudo screencapture a.png`
+holding option during startup shows Startup Manager and holding shift starts up in safe mode
+command-R starts up from the recovery partition, command-S starts up in single user mode, and command-V starts up in verbose mode
+`mount -uw /;launchctl load /S*/*/LaunchDaemons/*.{notifyd,kextd}.plist;mkdir a;mount_hfs /dev/disk1s2 a` mounts a drive in single user mode
+you can reinstall OS X over an existing installation by starting up from the recovery partition and choosing Reinstall OS X
+you can erase and reinstall OS X by starting up from the recovery partition, erasing the OS X partition, and choosing Install OS X
+`open -Rh Events.h` reveals Events.h in Finder
+`grep 'BSD process name' /Library/Logs/DiagnosticReports/*.panic` shows what processes caused kernel panics
+`cat "$(ls -dt ~/Library/Logs/DiagnosticReports/*|head -n1)"` shows the newest crash report
+
+#AppleFontSmoothing
+you can make OS X use a lighter text rendering style by running `defaults write -g AppleFontSmoothing -int 1` and reopening applications
+1 corresponds to the "Light" setting that was included in System Preferences in 10.5 and earlier
+3 corresponds to "Strong", 0 corresponds to "Standard - Best for CRT", and 2 corresponds to "Medium - Best for Flat Panel"
+
+#installing bash 4
+run `brew install bash;echo /usr/local/bin/bash|sudo tee -a /etc/shells;chsh -s /usr/local/bin/bash`
+`chsh -s` changes the default login shell
+chsh only allows selecting shells in /etc/shells
+you can also change the default login shell from System Preferences or by running `sudo dscl . -change $HOME UserShell /usr/local/bin/bash`
+
+#cron
+the crontab format is described in `man 5 crontab`
+cron adds a message to /var/mail/ when a command has any STDOUT or STDERR output
+adding MAILTO="" to the start of a crontab makes cron not send mail messages
+you can remove existing mail messages by running `sudo rm /var/mail/$USER`
+the default path is /usr/bin:/bin even if you have changed the path in /etc/launchd.conf
+the default shell is /bin/sh, but you can change it by adding adding a line like SHELL=/usr/local/bin/bash to the start of a crontab
+the locale variables are unset by default, but you can change them by adding a line like LANG=en_US.UTF-8 to the start of a crontab
+the root has its own crontab which can be edited with `sudo crontab -e`
+% is replaced with a newline in the command field so % has to be escaped as \%
+\ does not have to be escaped as \\ unless it precedes %
+1-3,5 is equivalent to 1,2,5 and 1-7/2 is equivalent to 1,3,5,7
+@hourly is equivalent to `0 * * * *` and @daily is equivalent to `0 0 * * *`
+@reboot runs a command after restarting but not after logging out and back in
+/etc/crontab uses a different format where the sixth field is the username, like `* * * * * username command`
+you can enable logging by adding `cron.* /var/log/cron.log` to /etc/syslog.conf and then unloading and loading com.apple.syslogd.plist
+the files for crontabs are stored in /var/at/tabs/
+/usr/lib/cron is a symlink to /var/at
+/System/Library/LaunchDaemons/com.vix.cron.plist has /usr/lib/cron/tabs in QueueDirectories
+
+#setting a default path
+run for example `echo setenv PATH /Users/username/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin|sudo tee -a /etc/launchd.conf` and restart
+
+#setting environment variables with launchd
+`launchctl setenv var value` changes var for all new child processes of the user's launchd process until the launchd process exits
+`echo setenv var value|sudo tee -a /etc/launchd.conf` changes var permanently
+you can apply changes to /etc/launchd.conf by restarting
+`launchctl export` shows the environment variables of the user's launchd process
+`sudo launchctl export` shows the environment variables of the root launchd process
+`sudo launchctl export` does not print anything by default
+variables set in /etc/launchd.conf are listed by both `launchctl export` and `sudo launchctl export`
+`man launchd.conf` says that ~/.launchd.conf is currently unsupported, and I haven't gotten settings in ~/.launchd.conf to have any effect
+~/.MacOSX/environment.plist stopped working in 10.8
+
+#path_helper, /etc/paths, and /etc/paths.d/
+/usr/libexec/path_helper adds lines in /etc/paths and /etc/paths.d/* to the path
+path_helper is run from /etc/profile, /etc/zsh.env, and /etc/csh.login
+zsh reads /etc/zsh.env even for non-login shells but bash does not read /etc/profile for non-login shells
+path_helper is not run by graphical applications like Xcode or Emacs.app
+/etc/paths contains /usr/local/bin at the end by default
+there are no files in /etc/paths.d/ by default, but for example the XQuartz and MacTeX installers add files to /etc/paths.d/
+I prefer changing the path in /etc/launchd.conf because it also affects processes that are not started from shells
+
+#erasing an SSD securely
+the option to erase a disk securely in Disk Utility has been disabled for SSDs since 10.7
+according to a KB article by Apple, erasing an SSD normally might be secure enough or make it difficult to recover data
+it is still possible to run something like `diskutil secureErase 4 disk0s2` from Terminal on the recovery partition
+I don't know if using `diskutil secureErase` is more secure than erasing an SSD normally
+another option is to turn on FileVault 2 before erasing the drive, but enabling encryption after an SSD has already been used is not necessarily secure either
+
+#Internet Recovery mode
+Internet Recovery mode is supported by all Macs that came with 10.7 or later and by some older Macs after a firmware update
+Internet Recovery mode means that the Mac downloads a disk image for the recovery system from Apple's servers
+you can use Internet Recovery to install OS X on an empty drive after you replace a drive or erase a drive completely
+option-command-R forces starting up in Internet Recovery mode
+
+#startup keys
+command-R starts from a recovery partition
+command-S starts up in single user mode
+command-V starts up in verbose mode
+option opens Startup Manager
+shift starts up in safe mode
+C starts up from an optical disk
+D opens Apple Hardware Test
+N attempts to start up from a NetBoot server
+T starts up in target disk mode
+option-N starts from a NetBoot server using the default boot image
+holding P and R while holding option and command resets NVRAM or PRAM
+holding eject, F12, or a button on a pointing device ejects removable media like optical disks
+option-command-R starts up in Internet Recovery mode
+holding 6 and 4 starts up using a 64-bit kernel
+holding 3 and 2 starts up using a 32-bit kernel
+
+#mounting an external drive in single user mode
+run `mount -uw /`
+run `launchctl load /System/Library/LaunchDaemons/com.apple.{notifyd,kextd}.plist`
+run `mkdir /tmp/a;mount_hfs /dev/disk1s2 /tmp/a` where disk1s2 is an identifier shown by `diskutil list`
+
+#resource forks
+resource forks are not stored as extended attributes even though they can be accessed and modified through the extended attribute interface
+`cat file/..namedfork/rsrc` or `xattr -p com.apple.ResourceFork file` shows the contents of a resource fork
+`cat file/rsrc` stopped working in 10.7
+`xattr -dr com.apple.ResourceFork .` removes resource forks recursively
+`find . -type f -xattrname com.apple.ResourceFork` or `find . -type f -exec test -s {}/..namedfork/rsrc \; -print` finds files with resource forks
+resource forks are used to store custom icons set in Finder, the images of Icon\r files, file-specific default applications, and information about aliases
+if you delete the resource fork of an alias file, the alias stops working
+resource forks are used to store script objects in scpt files, AppleScript Editor window state, and RTF descriptions of scripts
+
+#AppleDouble files
+AppleDouble files are used to store extended attributes, resource forks, ACLs, and file flags on non-HFS+ volumes and in archives
+Archive Utility and /usr/bin/tar create AppleDouble files but /usr/bin/zip doesn't
+zip archives created with Archive Utility include a __MACOSX folder for AppleDouble files
+`COPYFILE_DISABLE= tar -cf folder.tar folder` creates a tar archive without AppleDouble files
+`zip folder.zip -r folder` creates a zip archive without AppleDouble files
+`ditto -c -k --sequesterRsrc --keepParent folder folder.zip` creates a zip archive that includes AppleDouble files
+`ditto -x -k dir.zip` extracts an archive and convert metadata stored in AppleDouble files back to native formats
+`find . -name ._\* -delete` deletes AppleDouble files
+`dot_clean .` deletes AppleDouble files after converting metadata to native formats
+
+#Spotlight comments
+Spotlight comments added from Finder are stored both in .DS_Store files and as extended attributes
+if you use Finder to add a Spotlight comment for a file you don't have write permission to, the comment is not saved as an external attribute
+Spotlight comments that are not saved as extended attributes are not seen by Spotlight
+if you delete .DS_Store files, Spotlight comments are still seen by Spotlight, but they are not shown in Finder's information windows
+
+#default view modes and view options in Finder
+the view mode that is used for new windows is changed when you close a Finder window
+I don't know any way to set a default view mode permanently
+the "Always open in" checkbox enables saving a folder-specific default view mode in a .DS_Store file
+if you check "Always open in column view" and change the view mode to icon view, the folder-specific default view mode becomes icon view
+the "Use as Defaults" button changes some of the settings in ~/Library/Preferences/com.apple.Finder.plist
+the settings saved with "Use as Defaults" are not used for folders that have folder-specific settings saved in a .DS_Store file
+there is no "Use as Defaults" button in column view because the settings in the two bottom sections of the view options panel are the same for all folders
+
+#HFS compression
+support for HFS compression was added in 10.6
+HFS compression is enabled for many of the files that are installed with OS X
+most command line utilities and graphical applications display the uncompressed sizes for files
+you can see the compressed size of a file with `sudo fileXray --diskusage`
+when a file is compressed, the data is stored in the resource fork and the data fork is empty
+compressed files have a com.apple.decmpfs extended attribute that is hidden by xattr
+`ditto --hfsCompression file1 file2` makes a compressed copy of file1 to file2
+`cp file1 file2` or `ditto --nopreserveHFSCompression file1 file2` makes a non-compressed copy of file1 to file2
+`stat -f%f` prints 32 if a file is compressed and has no other flags
+`ls -lO` displays `compressed` if a file is compressed
+you can use Clusters.app to enable HFS compression for user files
+
+#com.apple.quarantine
+the com.apple.quarantine extended attributes have values like 0042;5106ce90;Safari;119A94C7-09B5-4E53-805C-3CA43B6B9612
+the second field is a timestamp
+the fourth field corresponds to a UUID in ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsv2
+the first field is a hexadecimal bitfield
+the seventh bit of the first field gets set after you open a file
+the sixth bit of the first field gets set if you try to open a file but press cancel in the warning dialog
+
+#ssh-keygen
+you can create ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub by running ssh-keygen and acceping the defaults in every step
+you can make the key pair passphraseless by pressing return in the step for entering a password
+if you enter a password, you can choose to save it to OS X's keychain later so you won't have to type it manually
+you can upload the public key to a host by running `ssh user@host 'cat>>~/.ssh/authorized_keys'<~/.ssh/id_rsa.pub` or by running ssh-copy-id
+if ~/.ssh/ or ~/.ssh/authorized_keys doesn't exist on the host, run `mkdir -p ~/.ssh/;chmod 700 ~/.ssh/;chmod 600 ~/.ssh/authorized_keys`
+old versions of OpenSSH used authorized_keys2 for SSH2 and authorized_keys for SSH1
+authorized_keys2 is now deprecated and authorized_keys is used for both SSH2 and SSH1
+
+#folder actions
+a folder action can be an AppleScript with an `adding folder items` handler or an Automator workflow created using the Folder Action template
+Folder Actions Setup only allows selecting scripts and workflows in `~/Library/Workflows/Applications/Folder Actions/`
+Folder Actions Setup modifies ~/Library/LaunchAgents/com.apple.FolderActions.{enabled,folders}.plist
+folder actions were reimplemented so that they rely on launchd in 10.5 and support for creating folder actions with Automator was added in 10.6
+the com.apple.FolderActions.folders job gets throttled if a folder with folder actions is modified within 10 seconds from the last invocation
+sometimes the current window loses focus for a split second when a folder action is run, but I don't know any workarounds for it
+one advantage folder actions have over launchd jobs is that folder actions can get the modified files as input but launchd jobs cannot
+there are some example scripts in `/Library/Scripts/Folder Action Scripts/`
+
+#logout hooks
+logout hooks were deprecated in 10.4 but they still work as of 10.9
+I haven't figured out any way to reliably run programs on logout with launchd
+`sudo defaults write com.apple.loginwindow LogoutHook ~/.logouthook` adds a logout hook
+the value of the LogoutHook key can only be a path to an executable not a shell command
+there can be only one logout hook, but it can be a script that runs multiple programs
+`sudo defaults write com.apple.loginwindow` modifies /var/root/Library/Preferences/com.apple.loginwindow.plist
+adding a LogoutHook key to /Library/Preferences/com.apple.loginwindow.plist does not work
+if a logout hook takes long enough to run, a gray screen is shown until the logout hook terminates
+there is no time limit after which a logout hook is forced to terminate
+
+#using an OS X VM with VMware Fusion
+VMware Fusion 5 does not support Mavericks but VMware Fusion 6 does
+you can create a VM from an OS X installer application downloaded from App Store
+if you download a torrent for OS X, just download an unmodified OS X installer application or disk image and not any modified ISO or VM image meant for PCs
+installing VMware Tools adds support for other resolutions than the default resolution and for copy and paste between the guest and host
+if you want to restore the VM to the initial state later, take a snapshot before you start using the VM or after you install VMware Tools
+you can copy files between a VM and the host by adding a shared folder from Virtual Machine > Settings > Sharing
+
+#manual two-sided printing
+select Paper Handling > Pages to Print > Odd Only and print
+if the total number of pages is odd, either remove the last page or don't remove any pages depending on the printer
+depending on the printer, either flip the pile of papers and set the order to reverse or don't flip the papers and don't set the order to reverse
+select Even Only and print
+
+#decomposed filenames
+HFS+ stores many characters in decomposed form instead of composed form
+for example LATIN SMALL LETTER A WITH DIAERESIS is stored as LATIN SMALL LETTER A followed by COMBINING DIAERESIS
+HFS+ uses a variant of NFD where some characters are not decomposed
+`iconv -f utf-8-mac -t utf-8` converts text from the NFD variant used by HFS+ to NFC
+`touch $'\xc3\xa4';ls|tr -d \\n|xxd -p` prints 61cc88
+`touch $'\xc3\xa4';ls|tr -d \\n|iconv -f utf-8-mac -t utf-8|xxd -p` prints c3a4
+bash 4.1 and later treat the decomposed and precomposed forms of characters as equivalent for filename completion and globbing
+a precomposed a-umlaut completes to a decomposed a-umlaut in bash 4.1 but not in bash 3.2
+
+#pbpaste and pbcopy encodings
+pbpaste and pbcopy don't preserve non-ASCII characters in the C locale
+Terminal and iTerm 2 set LANG to a value like en_US.UTF-8 by default
+the locale variables are unset by default in other applications like Automator and AppleScript Editor
+if you for example run `do shell script "pbpaste"` in AppleScript Editor, it doesn't preserve non-ASCII characters