Skip to content

Instantly share code, notes, and snippets.

@magnars
magnars / setup-hippie.el
Created November 12, 2012 17:23
Hippie Expand: use closest matches first
;; To use, replace these values in your hippie-expand-try-functions-list:
;;
;; try-expand-dabbrev => try-expand-dabbrev-closest-first
;; try-expand-line => try-expand-line-closest-first
;;
(defvar he-search-loc-backward (make-marker))
(defvar he-search-loc-forward (make-marker))
(defun try-expand-dabbrev-closest-first (old)
@magnars
magnars / *scratch3*.el
Created November 20, 2012 09:20
Project specific settings in Emacs
(add-hook
'find-file-hook
(lambda ()
(when (string-match-p "projects/my-project" (buffer-file-name))
(setq js2-additional-externs '("my" "additional" "externs")))))
@magnars
magnars / kmbot.el
Created November 24, 2012 21:35
Emacs bot til Kodemakers irc-kanal
(require 's)
(require 'cl)
(require 'assoc)
(defvar kmbot--file ".kmbot-memory.el")
(defvar kmbot--definitions nil)
(defun kmbot--dump-list (list-symbol)
"Insert (setq LIST-SYMBOL LIST-VALUE) to current buffer."
(let ((value (symbol-value list-symbol)))
;; Use lambda for anonymous functions
(font-lock-add-keywords
'js2-mode `(("\\(function\\) *("
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "\u0192")
nil)))))
;; Keep emacs Custom-settings in separate file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
(defvar adv-destination-room-overlay nil)
(make-variable-buffer-local 'adv-destination-room-overlay)
(defun adv-fontify-destination-room (s)
(set-text-properties
0 (length s)
`(face (:foreground ,(format "#%02x%02x%02x" 30 30 30)))
s)
s)
printf "\n\033[34moiiku-attendants-app: \033[0m"
cd oiiku-attendants-app && git status
printf "\n\033[34moiiku-central-api: \033[0m"
cd ../oiiku-central-api && git status
printf "\n\033[34moiiku-dev-tools: \033[0m"
cd ../oiiku-dev-tools && git status
printf "\n\033[34moiiku-event-admin: \033[0m"
cd ../oiiku-event-admin && git status
printf "\n\033[34moiiku-grails-starterkit: \033[0m"
cd ../oiiku-grails-starterkit && git status
(require 'flycheck)
(defun magnars/adjust-flycheck-automatic-syntax-eagerness ()
"Adjust how often we check for errors based on if there are any.
This lets us fix any errors as quickly as possible, but in a
clean buffer we're an order of magnitude laxer about checking."
(setq flycheck-idle-change-delay
(if flycheck-current-errors 0.3 3.0)))
(function () {
buster.testCase("dom", {
"assert.called fails in IE8, this is the minimal case": function () {
var spy = this.spy();
spy(document.createElement("input"));
assert.called(spy);
}
});
[refute.calledWith] Expected function updateValidationError() {} not to be called with arguments 'dummy value'
updateValidationError({ completeCallback: function () {}, editCallback: function () {}, id: 1, onComplete: function () {}, onEdit: function () {} })