This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun magit-clone-url () | |
(interactive) | |
(let ((git-repo-url (read-from-minibuffer "Enter git repo URL: "))) | |
(magit-git-command (concat " clone " git-repo-url) | |
default-directory))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package eclim | |
:load-path ("/Users/yves/.emacs.d/vendor/emacs-eclim") | |
:init (setq help-at-pt-display-when-idle t | |
help-at-pt-timer-delay 0.1 | |
eclimd-executable "~/Tools/eclipse/eclimd" | |
eclim-executable "~/Tools/eclipse/eclim" | |
eclimd-default-workspace "~/Documents/workspace/" | |
eclim-eclipse-dirs '("~/Tools/eclipse")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn levenshtein-distance [w1 w2] | |
"Computes the levenshtein distance between two words." | |
(letfn [(cell-value [ch1 ch2 prev-row acc col-idx] | |
(min (inc (nth prev-row col-idx)) | |
(inc (last acc)) | |
(+ (nth prev-row (dec col-idx)) (if (= ch1 ch2) 0 1))))] | |
(loop [row-idx 1, max-rows (inc (count w2)), prev (range (inc (count w1)))] | |
(if (= row-idx max-rows) | |
(last prev) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn levenshtein-distance [w1 w2] | |
(letfn [(distance [matrix] | |
(last (last matrix))) | |
(make-matrix [word1 word2] | |
(let [matrix (into [] | |
(for [i (range (inc (count word1)))] | |
(into [] (take (inc (count word2)) (iterate inc 0)))))] | |
;; new matrix | |
(reduce (fn [acc idx] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style=java | |
indent-classes | |
indent=spaces=8 | |
#brackets=linux | |
break-closing-brackets | |
indent-labels | |
pad-oper | |
unpad-paren | |
keep-one-line-blocks | |
convert-tabs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"libs": ["ecma5"], | |
"loadEagerly": ["web-app/libs/*.js"], | |
"plugins": { | |
"angular": true, | |
"jquery": true, | |
"node": {} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun jump-to-file-register () | |
"Jump to a file register using completing-read" | |
(interactive) | |
(let* ((reg-list (cl-loop for ptr-reg in register-alist | |
when (eq 'file (first (last ptr-reg))) | |
collect (concat (char-to-string (car ptr-reg)) "|" (cdr (last ptr-reg))))) | |
(reg-data (completing-read "Pick file register: " reg-list)) | |
(reg-location (string-to-char (car (split-string reg-data "|"))))) | |
(jump-to-register reg-location))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun eclim-java-format () | |
"Format the source code of the current java source file." | |
(interactive) | |
(let ((positions (if (region-active-p) | |
(list (region-beginning) (region-end)) | |
(list 0 (1- (point-max)))))) | |
(eclim/execute-command "java_format" "-p" "-f" ("-h" (car positions)) ("-t" (cadr positions) ) "-e"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ers/eclim-new-type (new_type_name new_type) | |
(interactive (list (read-string "Type name: ") | |
(completing-read "Type: " '("class" | |
"abstract" | |
"interface" | |
"enum" | |
"@interface")))) | |
(let* ((prj-dir (or (eclim-project-name) (eclim-project-name (dired-current-directory)))) | |
(eclim-newtype-args (list "java_new" | |
"-p" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar paste-c-net-url "https://paste.c-net.org/") | |
(defvar paste-c-net-buffer-name "*paste-c-net*") | |
(defun paste-c-net--buffer-whole-string (buffer) | |
"Retrieve the text contents from an HTTP response BUFFER." | |
(with-current-buffer buffer | |
(save-restriction | |
(widen) | |
(re-search-forward "^$") | |
(buffer-substring-no-properties (point) (point-max))))) |
OlderNewer