Skip to content

Instantly share code, notes, and snippets.

View tavisrudd's full-sized avatar

Tavis Rudd tavisrudd

View GitHub Profile
(require 'eldoc)
(defun clojure-slime-eldoc-message ()
(when (and (featurep 'slime) (slime-background-activities-enabled-p))
(slime-echo-arglist);async
nil ; show nothing now
))
(defun clojure-localize-documentation-function ()
(set (make-local-variable 'eldoc-documentation-function)
'clojure-slime-eldoc-message))
@tavisrudd
tavisrudd / clojure-ignore-form.el
Created January 27, 2012 19:31
A handy elisp function for inserting, toggling or moving Clojure's #_ reader macro.
(defun dss/clojure-ignore-form ()
"Inserts, toggles, or moves Clojure's #_ ignore-next-form reader macro."
(interactive)
(flet ((in-string-p () (eq 'string (syntax-ppss-context (syntax-ppss))))
(in-comment-p () (eq 'comment (syntax-ppss-context (syntax-ppss)))))
(skip-chars-forward " ")
(while (in-string-p)
(backward-char))
(cond
;; switch from a comment to an ignore form, if paredit is enabled
@tavisrudd
tavisrudd / shift-arrows.el
Created February 3, 2012 03:01
shift-arrow key support for emacs inside of gnu screen
(define-key global-map "\eO2D" (kbd "S-<left>"))
(define-key global-map "\eO2C" (kbd "S-<right>"))
(define-key global-map "\eO2A" (kbd "S-<up>"))
(define-key global-map "\eO2B" (kbd "S-<down>"))
(define-key global-map "\e[1;10D" (kbd "M-S-<left>"))
(define-key global-map "\e[1;10C" (kbd "M-S-<right>"))
(define-key global-map "\e[1;10A" (kbd "M-S-<up>"))
(define-key global-map "\e[1;10B" (kbd "M-S-<down>"))
@tavisrudd
tavisrudd / dss-buffer-and-window-handling.el
Created March 8, 2012 07:22
a collection of handy emacs window management functions and a few for buffers
(require 'ibuffer)
(defalias 'list-buffers 'ibuffer)
(require 'ibuffer-vc)
(setq ibuffer-formats
'(
(mark dss-modified vc-status-mini " "
(name 35 35 :left :elide)
;; " " (mode 10 10 :left :elide)
" " filename-and-process)
@tavisrudd
tavisrudd / cocoa_keypress_monitor.py
Created July 6, 2012 22:45 — forked from ljos/cocoa_keypress_monitor.py
Showing how to listen to all keypresses in OS X through the Cocoa API using Python and PyObjC
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
from AppKit import NSApplication, NSApp
from Foundation import NSObject, NSLog
from Cocoa import NSEvent, NSKeyDownMask
from PyObjCTools import AppHelper
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
mask = NSKeyDownMask
@tavisrudd
tavisrudd / generative.clj
Created July 20, 2012 18:25 — forked from cemerick/generative.clj
"Integrating" clojure.test and test.generative
;; My good-enough glomming together of clojure.test and test.generative
(ns cemerick.generative
(:require [clojure.test.generative.generators :as gens]
[clojure.test.generative :as gen])
(:use clojure.test))
;; Too bad last-report isn't sent an action upon success as well.
;; Perhaps this should just be replaced with a try/catch/rethrow
;; around the body in defspectest
@tavisrudd
tavisrudd / lxc-ubuntu.sh
Created July 22, 2012 07:17 — forked from michaelcontento/lxc-ubuntu.sh
Script to generate LXC containers for EC2
#!/bin/bash
#
# Template script for generating ubuntu container for LXC with the same
# ubuntu relase as the host
#
# This script is based on lxc-debian for EC2 (Daniil Kulchenko <daniil@kulchenko.com>)
# wich itself is based on lxc-debian (Daniel Lezcano <daniel.lezcano@free.fr>)
#
@tavisrudd
tavisrudd / phantom_buster.js
Created November 5, 2012 18:24
phantom.js buster test runner capture script with retry logic
var system = require('system'),
captureUrl = 'http://localhost:1111/capture';
if (system.args.length==2) {
captureUrl = system.args[1];
}
var captured = false;
var locked = false;
var captureAttempts = 0;
var page = new WebPage();
@tavisrudd
tavisrudd / kinesis.txt
Created March 2, 2013 18:10
A partial list of the Kinesis Advantage / Controllermate / Emacs keybinding tweaks I've done.
Remapped on kinesis itself
--------------------------------------------------------------------------------
caps lock -> backspace (freq use)
backspace -> right gui/windows (freq use)
left alt -> return/enter (very infreq use)
right ctrl -> return/enter (freq use)
right gui/windows -> left gui
enter -> right gui (infreq use)
@tavisrudd
tavisrudd / links.txt
Created March 23, 2013 04:55
some links related to my voice coding talk at #pycon