Skip to content

Instantly share code, notes, and snippets.

https://gist.github.com/anonymous/1d97377be54fd02da8b050783cfbf2ad
#+BEGIN_SRC
#lang racket
(define (run-gs-command repo)
(with-output-to-string
(thunk
(system
(format "cd ~s; git status -s" repo)))))
(eval-after-load 'dired
'(progn
;; use the standard Dired bindings as a base
(defvar dired-mode-map)
(evil-make-overriding-map dired-mode-map 'normal)
(evil-add-hjkl-bindings dired-mode-map 'normal
"J" 'dired-goto-file ; "j"
"K" 'dired-do-kill-lines ; "k"
"r" 'dired-do-redisplay ; "l"
;; ":d", ":v", ":s", ":e"
(defun embiggen-steve ()
(interactive)
(set-face-attribute 'default nil :height 170))
(defun not-steve ()
(interactive)
(set-face-attribute 'default nil :height 125))
(global-set-key (kbd "s-e") 'embiggen-steve)
(global-set-key (kbd "s-E") 'not-steve)
src/main.rs:73:25: 73:30 error: cannot move out of captured outer variable in an `Fn` closure
src/main.rs:73 do_log_time(thing, Some(thing))
^~~~~
<nickel macros>:1:1: 1:27 note: in expansion of as_block!
<nickel macros>:10:12: 10:42 note: expansion site
note: in expansion of closure expansion
<nickel macros>:9:6: 10:54 note: expansion site
<nickel macros>:1:1: 10:62 note: in expansion of _middleware_inner!
<nickel macros>:4:1: 4:60 note: expansion site
<nickel macros>:1:1: 7:46 note: in expansion of middleware!
@joelmccracken
joelmccracken / kernel.el
Created November 14, 2014 19:01
elisp kernel
;; -*- lexical-binding: true; -*-
(defun kernel--make-vau (params env body-exprs)
(list '%Vau params env body-exprs))
(defun kernel--vau-params (vau) (nth 1 vau))
(defun kernel--vau-env (vau) (nth 2 vau))
(defun kernel--vau-body (vau) (nth 3 vau))
(defun kernel--type (thing)
(defun kernel--zip (a b)
(if (or a b)
(cons (cons (car a)
(car b))
(kernel--zip (cdr a)
(cdr b)))
nil))
(kernel--zip '(1 2 3) '(4))
team([]).
team([Pokemon|Team]) :- pokemon(Pokemon), \+ member(Pokemon, Team), team(Team).
@joelmccracken
joelmccracken / gist:9859284
Created March 29, 2014 18:10
execute a single key combo when in term character mode in emacs
(defun jnm/single-command-outside-of-term-mode ()
(interactive)
(cl-flet ((do-cmd ()
(call-interactively (key-binding (read-key-sequence "key sequence: ")))))
(if (term-in-line-mode)
(do-cmd)
(term-line-mode)
(do-cmd)
(term-char-mode))))
:- dynamic foo/1.
['simple-data.prolog'].
save :- tell('simple-data.prolog'), listing, told.
@joelmccracken
joelmccracken / git-on-branch.sh
Created February 27, 2014 17:29
perform command on another branch
git-on-branch () {
git stash
ORIGINAL_BRANCH=`git branch | grep \* | sed 's/\*[[:space:]]//'`
git checkout $1
$2
git checkout $ORIGINAL_BRANCH
git stash pop
}