Skip to content

Instantly share code, notes, and snippets.

;; shorthand for interactive lambdas
(defmacro λ (&rest body)
`(lambda ()
(interactive)
,@body))
(global-set-key (kbd "s-l") (λ (insert "\u03bb")))
(function () {
"use strict";
buster.testCase("refute.calledWith fails badly in IE8", {
"it's just crazy dude": function () {
var spy = this.spy();
spy("'actual-value'");
refute.calledWith(spy, "'test-value'");
}
});
[refute.calledWith] Expected function updateValidationError() {} not to be called with arguments 'dummy value'
updateValidationError({ completeCallback: function () {}, editCallback: function () {}, id: 1, onComplete: function () {}, onEdit: function () {} })
(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);
}
});
(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)))
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
(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)
;; Keep emacs Custom-settings in separate file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
;; Use lambda for anonymous functions
(font-lock-add-keywords
'js2-mode `(("\\(function\\) *("
(0 (progn (compose-region (match-beginning 1)
(match-end 1) "\u0192")
nil)))))
@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)))