Skip to content

Instantly share code, notes, and snippets.

;; Protect against accidental pushes to certain branches, eval it after magit initializes.
(with-eval-after-load 'magit
(defadvice magit-git-push
(around my-protect-accidental-magit-git-push)
"Ask the user for confirmation before pushing to certain branches."
(if (member (ad-get-arg 0) '("develop" "master"))
(if (yes-or-no-p (format "Push branch %s to %s?" (ad-get-arg 0) (ad-get-arg 1)))
ad-do-it
(error "Push aborted by user"))
ad-do-it))
@thejan2009
thejan2009 / buftabs.js
Last active August 29, 2015 14:11 — forked from s2marine/buftabs.js
// {{{ Information
let INFO = xml`
<plugin name="buftabs" version="1.0"
href=""
summary="Buftabs: show the tabbar in the statusline"
xmlns="http://vimperator.org/namespaces/liberator">
<author email="s2marine0@gmail.com">s2marine</author>
<license href="">GPLv3</license>
<p>
This is a fork from Lucas de Vries's buftabs (https://github.com/GGLucas/vimperator-buftabs).