Skip to content

Instantly share code, notes, and snippets.

(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
(defun markp ()
(condition-case nil
(mark)
(mark-inactive nil)))
(defun gist-region-or-buffer ()
"Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com
Copies the URL into the kill ring."
(interactive)
(condition-case nil
(gist-region (point) (mark))
(mark-inactive (gist-buffer))))
(defun merb-console (app host user &optional env working-dir)
"Connect to a remote host and run merb"
(interactive)
(require 'inf-ruby)
(let ((buffer-name-for-comint (concat app "-console"))
(buffer-name (concat "*" app "-console*"))
(env (if env env "production"))
(working-dir (if working-dir working-dir
(concat "/data/" app "/current")))
(cmdlist `("ssh" ,host "-t"
function rake() {
if [ -e bin/rake ]; then
bin/rake $*
else
`which rake` $*
fi
}
;;; very basic cucumber mode for plain text stories
;;; send updates to ivey@gweezlebur.com and maybe I'll
;;; release this on github
(defvar cucumber-mode-story-regexp
"^ *\\(Story:\\) *\\(.*\\)")
(defvar cucumber-mode-scenario-regexp
"^ *\\(Scenario:\\) *\\(.*\\)")
(defvar cucumber-mode-asiwantto-regexp
"^ *\\(As \\(an\\|a\\)\\|I want to\\|So that\\) *\\(.*\\)")
@ivey
ivey / .emacs
Created October 13, 2008 16:26
(defun open-next-http-url ()
"Search forward to the next http/https URL, and open it"
(interactive)
(nonincremental-re-search-forward "https*://")
(browse-url-at-point)
)
(defun my-erc-joined-channels ()
"Return all the channels you're in as a list. This does not include queries."
(save-excursion
;; need to get out of ERC mode so we can have *all* channels returned
(set-buffer "*scratch*")
(mapcar #'(lambda (chanbuf)
(with-current-buffer chanbuf (erc-default-target)))
(erc-channel-list erc-process))))
(defun mark-channel (channel)
thor merb:source:list available|grep \- |f 2|sed -e 's/://'|xargs -n 1 thor merb:source:clone
@ivey
ivey / config
Created October 23, 2008 17:34
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url = git://github.com/wycats/merb.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]