Skip to content

Instantly share code, notes, and snippets.

View rawsyntax's full-sized avatar

Eric Himmelreich rawsyntax

View GitHub Profile
(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)
@rawsyntax
rawsyntax / init.el
Created June 11, 2012 21:01
setup elisp package manager
(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)
@rawsyntax
rawsyntax / config
Created July 11, 2012 16:43
faster ssh
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
#!/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
@rawsyntax
rawsyntax / magit-commit-template.el
Last active January 5, 2019 15:41
magit commit hook template
;; 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)))
@rawsyntax
rawsyntax / ui.el
Last active May 14, 2017 16:18
reset ui and toggle eshell visor
;;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
@rawsyntax
rawsyntax / bindings.el
Created February 23, 2013 22:10
key bindings
(global-set-key (kbd "\C-cu") 'reset-ui)
(global-set-key (kbd "C-c t") 'toggle-eshell-visor)
(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)))
@rawsyntax
rawsyntax / zip.txt
Created May 8, 2013 21:35
zip codes
79936
90011
60629
90650
90201
77084
92335
78521
77449
78572
@rawsyntax
rawsyntax / markaby_example.rb
Last active December 18, 2015 17:19
markaby builder example
require 'markaby'
m = Markaby::Builder.new
m.div({:id => "boosh", :class => "boosh"}) do
h1("boosh", {:id => "inner"})
end
#=> "<div id="boosh" class="boosh"><h1 id="inner">boosh</h1></div>"