Skip to content

Instantly share code, notes, and snippets.

{"date":"2013-10-30" , "goal": 3.14}
@bmnn
bmnn / gist:8243643
Last active January 2, 2016 03:28
set; environment variables; editor; windows;
SET EDITOR='C:\Users\mchl\Downloads\portableApps\emacs-24.3\bin\emacsclient.exe'
start "C:\Users\mchl\Downloads\portableApps\Console-2.00b148-Beta_32bit\Console2\Console.exe"
exit
@bmnn
bmnn / gist:8149933
Created December 27, 2013 17:26
emacs; icicles
(require 'icicles)
(icy-mode 1)
(global-set-key (kbd "C-c s") 'icicle-repeat-complex-command)
@bmnn
bmnn / gist:8149899
Created December 27, 2013 17:24
emacs; auto-complete; all buffers;
(require 'auto-complete-config)
(ac-config-default)
(setq-default
ac-sources '(
ac-source-words-in-all-buffer
ac-source-words-in-buffer
ac-source-files-in-current-dir
)
)
@bmnn
bmnn / gist:8087916
Created December 22, 2013 20:21
linux; artificial; eth0; device; mac; address; create; matlab; activation;
#r#(url='http://www.mathworks.com/matlabcentral/answers/73938#answer_83863')
modprobe dummy
ip l set dev dummy0 name eth0
sudo ip link set dev eth0 address 00:1e:37:d9:6c:a3
@bmnn
bmnn / gist:8051374
Created December 20, 2013 07:05
emacs; icicles; last command; repeat;
(require 'icicles)
(icy-mode 1)
(global-set-key (kbd "C-c s") 'icicle-repeat-complex-command)
@bmnn
bmnn / gist:8051364
Created December 20, 2013 07:04
emacs; clipboard; insert; put;
;r;(url='https://groups.google.com/d/msg/gnu.emacs.help/I2_E_eJxrcc/iwpwMYTleY0J')
(defun clipboard-get ()
"Visit clipboard-temp-file, delete all text in it, yank the X
clipboard, delete trailing whitespace, go to beginning of
buffer."
(interactive)
(delete-region (point-min) (point-max))
(clipboard-yank)
(delete-trailing-whitespace)
(goto-char (point-min)))
@bmnn
bmnn / gist:8051352
Last active December 31, 2015 22:09
emacs; git; shell; grep; save; change buffers; capture shell output; cd; replace regexp;
setq last-search "")
(defun gg (searchstring)
"git-grep the entire current repo"
(cd (replace-regexp-in-string "\n" "" (shell-command-to-string "git rev-parse --show-toplevel")))
(interactive (list (completing-read "Search for: " nil nil nil (concat
last-search " -e "))))
(when buffer-file-name (save-buffer))
(call-process "git" nil "*Messages*" nil "add" "- u")
(call-process "git" nil "*Messages*" nil "add" "\*.org")
(grep-find (concat "git grep -P -n -I -i --full-name --all-match " searchstring))
@bmnn
bmnn / gist:8018151
Created December 18, 2013 06:33
zsh; global alias; pipe; emacs client;
alias -g p2e='> ~/pipe && emacsclient --create-frame ~/pipe'
@bmnn
bmnn / gist:8003984
Created December 17, 2013 12:10
gmail; short cuts; cheatsheets;
%r%(url='http://gizmodo.com/5995218/a-cheat-sheet-of-every-single-gmail-keyboard-shortcut')
%r%(url='https://support.google.com/mail/answer/6594?hl=en&ctx=mail')
Tip: Press ? in Gmail to see a list of keyboard shortcuts.