This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun toggle-eshell-visor () | |
"Brings up a visor like eshell buffer, filling the entire emacs frame" | |
(interactive) | |
(if (string= "eshell-mode" (eval 'major-mode)) | |
(jump-to-register :pre-eshell-visor-window-configuration) | |
(window-configuration-to-register :pre-eshell-visor-window-configuration) | |
(call-interactively 'eshell) | |
(delete-other-windows))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "\C-cu") 'reset-ui) | |
(global-set-key (kbd "C-c t") 'toggle-eshell-visor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;default display position/size based on display resolution | |
;;warning: assumption that the 24/22 " displays are oriented | |
;; above the laptop's display | |
;; Haven't found a way to check multiple monitor | |
;; relative orientation via emacs yet... | |
;; | |
;; a frame is passed in when firing on after-make-frame-fuctions, | |
;; but not necessary when calling interactively | |
(defun reset-ui (&optional frame) | |
(if frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; TODO: pull author initials from (user-full-name) | |
(setq author-initials "EH") | |
(defun set-pivotal-story-id (id) | |
"sets current pivotal tracker story id" | |
(interactive "spivotal-story-id:") | |
(progn | |
(setq pivotal-story-id id))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# I use this script, then also create an alias, for example: | |
# mkdir -p /Users/eric/Downloads/tv && rsync-retry.sh [email protected]:~/torrents/eric/bitmetv/ /Users/eric/Downloads/tv | |
### ABOUT: See: http://gist.github.com/366269 | |
### Runs rsync, retrying on errors up to a maximum number of tries. | |
### On failure script waits for internect connection to come back up by pinging google.com before continuing. | |
### | |
### Usage: $ ./rsync-retry.sh source destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host * | |
# don't try to authenticate with Kerberos | |
GSSAPIAuthentication no | |
GSSAPIKeyExchange no | |
# persist the ssh connection for 5 minutes | |
# subsequent ssh connections respond faster because its reusing an existing connection | |
ControlMaster auto | |
ControlPath ~/.ssh/master-%r@%h:%p | |
ControlPersist 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
;; optionally add the marmalade repo to list-packages | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
(package-refresh-contents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'smex) | |
(smex-initialize) | |
(global-set-key (kbd "M-x") 'smex) | |
(global-set-key (kbd "M-X") 'smex-major-mode-commands) | |
(global-set-key (kbd "C-c M-x") 'smex-update) | |
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun scratch-js () | |
"Create or switch to a javascript mode scratch buffer" | |
(interactive) | |
(if (not (eq nil (get-buffer "scratch-js"))) | |
(switch-to-buffer "scratch-js") | |
(set-buffer (get-buffer-create "scratch-js")) | |
(js2-mode) | |
(switch-to-buffer "scratch-js"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode)) | |
;; Use js-mode indentation in js2-mode, I don't like js2-mode's indentation | |
;; | |
;; thanks http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode | |
;; with my own modifications | |
;; | |
(defun my-js2-indent-function () |