This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'analysis': { | |
'analyzer': { | |
'phone_number': { | |
'type': "edgeNGram", | |
'min_gram': 3, | |
'max_gram': 11, | |
'side': "back"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun scala-beginning-of-defun (&optional arg) | |
(re-search-backward "\\(\\(case\\s*\\)?class\\|def\\)" nil t arg)) | |
(defun scala-end-of-defun (&optional arg) | |
(scala-beginning-of-defun) | |
(goto-char (- (search-forward "{") 1)) | |
(forward-sexp)) | |
(eval-after-load "scala-mode" | |
(add-hook 'scala-mode-hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from operator import add, mul | |
def f(*args, **kwargs): | |
return lambda g: g(*args, **kwargs) | |
map(f(5, 5), (add, mul)) # -> [10, 25] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-hook 'find-file-hook | |
(lambda () | |
(when (and (not buffer-read-only) (bobp) (eobp) | |
(let ((table (yas/get-snippet-tables major-mode))) | |
(when table | |
(gethash "new-file" (elt (car table) 2))))) | |
(yas/expand-one "new-file") | |
(set-buffer-modified-p nil)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro absolute-dirname (path) | |
"Return the directory name portion of a path. | |
If PATH is local, return it unaltered. | |
If PATH is remote, return the remote diretory portion of the path." | |
`(cond ((tramp-tramp-file-p ,path) | |
(elt (tramp-dissect-file-name ,path) 3)) | |
(t ,path))) | |
(defmacro dir-locals (dir vars) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro with-ido (&rest body) | |
"Evaluate BODY with ido-mode enabled." | |
(let ((save-symbol (gensym "with-ido-save"))) | |
`(let ((,save-symbol (or ido-mode -1))) | |
(unwind-protect | |
(progn | |
(ido-mode 1) | |
,@body) | |
(ido-mode ,save-symbol))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar upside-down-alist | |
'((?a . ?ɐ) | |
(?b . ?q) | |
(?c . ?ɔ) | |
(?d . ?p) | |
(?e . ?ǝ) | |
(?f . ?ɟ) | |
(?g . ?ƃ) | |
(?h . ?ɥ) | |
(?i . ?ı) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function up () | |
{ | |
if [ "$1" != "" -a "$2" != "" ]; then | |
local DIR=$1 | |
local TARGET=$2 | |
elif [ "$1" ]; then | |
local DIR=$PWD | |
local TARGET=$1 | |
fi | |
while [ ! -e $DIR/$TARGET -a $DIR != "/" ]; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun pdl-agenda () | |
"Switch to my agenda, regenerating it in the process." | |
(interactive) | |
(save-selected-window | |
(pop-to-buffer | |
(prog1 org-agenda-buffer-name | |
(if (get-buffer org-agenda-buffer-name) | |
(org-agenda-redo) | |
(org-agenda nil "a") | |
(org-agenda-day-view)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* __ __ | |
* /.-' `-.\ | |
* // \\ | |
* /j_______________j\ | |
* /o.-==-. .-. .-==-.o\ | |
* || )) (( || | |
* \\____// \\____// | |
* `-==-' `-==-' | |
*/ |