Skip to content

Instantly share code, notes, and snippets.

View legumbre's full-sized avatar

Leonardo Etcheverry legumbre

  • GlamST / Ulta
  • Montevideo, Uruguay
View GitHub Profile
;; Objective-C
;; load objc-mode for Objective-C header files
(add-to-list 'magic-mode-alist
`(,(lambda ()
(and (string= (file-name-extension buffer-file-name) "h")
(re-search-forward "@\\<interface\\>"
magic-mode-regexp-match-limit t)))
. objc-mode))
;;set .m <-> .h correspondence for ff-find-other-file
;; ---------- Objective-C
;; load objc-mode for objective-C header files
(add-to-list 'magic-mode-alist
`(,(lambda ()
(and (string= (file-name-extension buffer-file-name) "h")
(re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))
. objc-mode))
;;set .m <-> .h correspondence for ff-find-other-file
(add-hook 'objc-mode-hook
;; ---------- Objective-C
;; load objc-mode for objective-C header files
(add-to-list 'magic-mode-alist
`(,(lambda ()
(and (string= (file-name-extension buffer-file-name) "h")
(re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))
. objc-mode))
# installing a device family on quartus (tested on quartus 11.0 for linux)
# install Cyclone III support
./quartus_sh --qinstall -qda "/path/to/devices/subscription/cycloneiii.qda" -show_qt_progress
;; Parenscript example
;;; /tmp/foo.lisp
(defun foo-bar-baz ()
"foo bar baz"
(mapcar (lambda (x) (+ 1 x)) (list 1 2 3)))
;; compile foo.lisp to foo.js
(with-open-file (stream "/tmp/foo.js" :direction :output :if-exists :supersede)
(format stream (ps-compile-file "/tmp/foo.lisp")))
/*
MozRepl setup for Conkeror and firefox-x11-devel-standalone
Reference:
http://conkeror.org/MozRepl -- Conkeror Wiki
https://github.com/bard/mozrepl/wiki -- MozRepl Wiki
https://github.com/bard/mozrepl/wiki/Use-with-Conkeror
*/
// 1. download mozrepl@hyperstruct.net.xpi in ~/conkeror/extensions/
@legumbre
legumbre / gist:1260490
Created October 3, 2011 22:59
VirtualBox port forwarding example
# VirtualBox port forwarding example (localhost:2222 -> vm:22)
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
# or e1000 if that's the virtual nic we're using
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/HostPort" 2222
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/GuestPort" 22
;; for fhrodes, advice jump-to-register so erc always scrolls to
;; bottom after a window config restore
(defadvice jump-to-register (after jump-to-register-and-scroll (register &optional del) activate)
"Scroll all erc buffers to bottom after jumping to a window configuration"
(when (window-configuration-p (car (get-register register)))
(mapcar (lambda (b) (with-current-buffer b
(when (eq major-mode 'erc-mode)
(goto-char (erc-end-of-input-line))
(erc-scroll-to-bottom (get-buffer-window b t) t))))
(buffer-list))))
;; for fhrodes, advice jump-to-register so erc always scrolls to
;; bottom after a window config restore
(defadvice jump-to-register (after jump-to-register-and-scroll (register &optional del) activate)
"Scroll all erc buffers to bottom after jumping to a window configuration"
(when (window-configuration-p (car (get-register register)))
(mapcar (lambda (b) (with-current-buffer b
(when (eq major-mode 'erc-mode)
(goto-char (erc-end-of-input-line))
(erc-scroll-to-bottom (get-buffer-window b t) t))))
(buffer-list))))
test2
test3
test4