Skip to content

Instantly share code, notes, and snippets.

Jerome Truong jqtruong

Block or report user

Report or block jqtruong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View custom-animated-google-maps-markers.markdown
jqtruong / window-control.el
Created Jul 25, 2013
Another example of a temporary overlay map in emacs...
View window-control.el
(defmacro repeater-map-more (keymaps &optional msg)
"For complex maps in which multiple repeatable keys are attached to
(let ((map (make-sparse-keymap)))
for (repeat-key fun) in ,keymaps
do (define-key map (vector repeat-key)
`(lambda () (interactive)
(if ,msg
jqtruong / skip-ads.el
Created Jul 23, 2013
When i feel like taking a break to watch a video but now ads are everywhere, thought of this neat elisp script to turn off the volume for a specified number of seconds (otherwise defaults to 30) and message me when the time's up on a Mac OS X, using osascript... now if there was a way to switch back to my browser :) i'll try that on stumpwm!
View skip-ads.el
(defun jqt/skip-ads (&optional seconds)
"SECONDS default to 30"
(interactive "p")
(let* ((seconds (number-to-string (or seconds 30)))
(command "osascript -e 'output volume of (get volume settings)'")
(output (shell-command-to-string command))
(current-volume (replace-regexp-in-string "[\s\n]" "" output))
(set-volume-command "osascript -e 'set volume output volume %s'"))
(shell-command (format set-volume-command 0))
(message "Ads stink! Turned volume (was at level %s) off for %s seconds..." current-volume seconds)
jqtruong / temporary-overlay-map-example.el
Last active Dec 19, 2015
Use set-temporary-overlay-map to create single keybindings and by learning to let go of emacs. Code learned from shell-switcher.el in which case C-' starts a shell then repeatedly hitting ' cycles to the next shell. In the example below, "C-, f" goes to the next window, then either b or f to move back and forth. The other example, "…
View temporary-overlay-map-example.el
;; macros ;;
(defmacro repeater-map (repeat-key fun)
"For one-key maps to repeatly called `fun'."
(let ((map (make-sparse-keymap)))
(define-key map (vector ,repeat-key)
map) t))
View hipchat.el
;; Connect using jabber-connect
;; My username from the HipChat configuration
;; from
(setq jabber-account-list '(("")))
;; To join HipChat rooms easily
(defvar hipchat-number "10804")
(defvar hipchat-nickname "Brian McKenna")
(defun hipchat-join (room)
You can’t perform that action at this time.