Skip to content

Instantly share code, notes, and snippets.

View ivey's full-sized avatar

Michael D. Ivey ivey

View GitHub Profile
@ivey
ivey / make-my-life-easier.diff
Created November 22, 2010 04:07
This should really be on all commands
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 8e562c7..5cded5d 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -155,6 +155,10 @@ module Bundler
method_option "production", :type => :boolean, :banner =>
"Deprecated, please use --deployment instead"
def install(path = nil)
+ if path == "help"
+ help("install")
(defun split-dedicated-window (b size)
(interactive "BBuffer: \nNLines to show: ")
(split-window (selected-window) (+ size 2))
(set-window-buffer (selected-window) b)
(set-window-dedicated-p (selected-window) t))
(defun erc-cmd-UNTRACK (&optional target)
"Add TARGET to the list of target to be tracked."
(if target
(erc-with-server-buffer
(let ((untracked (car (erc-member-ignore-case target erc-track-exclude))))
(if untracked
(erc-display-line
(erc-make-notice (format "%s is not currently tracked!" target))
'active)
(add-to-list 'erc-track-exclude target)
(defun comment-or-uncomment-region-or-line (&optional lines)
"If the line or region is not a comment, comments region
if mark is active, line otherwise. If the line or region
is a comment, uncomment."
(interactive "P")
(if mark-active
(if (< (mark) (point))
(comment-or-uncomment-region (mark) (point))
(comment-or-uncomment-region (point) (mark)))
(defun split-dedicated-window (b size)
(interactive "BBuffer: \nNLines to show: ")
(split-window (selected-window) (+ size 2))
(set-window-buffer (selected-window) b)
(set-window-dedicated-p (selected-window) t))
(defun insert-current-line ()
"insert the current line number into the current buffer."
(interactive)
(insert (number-to-string (line-number-at-pos))))
edit () {
new_args=()
LIMIT=$#
for ((i = 1; i <= $LIMIT; i++ )) do
eval file="\$$i"
if [[ -e $file && ! -O $file ]]
then
new_args[i]="/sudo::$file"
else
new_args[i]=$file
(define-ibuffer-filter filename-or-dired
"Toggle current view to buffers with filename or dired-directory matching QUALIFIER."
(:description "filename-or-dired"
:reader (read-from-minibuffer "Filter by filename (regexp): "))
(or
(ibuffer-awhen (buffer-local-value 'buffer-file-name buf)
(string-match qualifier it))
(ibuffer-awhen (buffer-local-value 'dired-directory buf)
(string-match qualifier it))))
# sudo/tramp friendly version of my edit command
# invokes Emacs on the file, but using sudo
function sedit() {
edit /sudo::$*
}