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
@legumbre
legumbre / calc-plot.txt
Created May 1, 2012 05:52
calc and gnuplot usage
# plotting with emacs calc and gnuplot
. 0
. [ value, value, value, value ]
g D dumb
g O stdout
g r xmin, xmax
g R ymin, ymax
g f
# plotting with emacs calc and gnuplot
. 0
. [ value, value, value, value ]
g D dumb
g O stdout
g r xmin, xmax
g R ymin, ymax
g C set terminal dumb 20,20 # canvas size
g f
100000000000 == 2048
101100001111 == 2831
110110100111 == 3495
111101100011 == 3939
111111111111 == 4095
111101100011 == 3939
110110100111 == 3495
101100001111 == 2831
100000000000 == 2048
010011110000 == 1264
@legumbre
legumbre / gist:2494323
Created April 25, 2012 23:12
point-conkeror-to-url
;; requires a connected mozrepl
(defun point-conkeror-to-url (url)
(with-temp-buffer
(insert
"repl.home();"
(concat "content.location.href= '" url "';")
"repl.enter(content); \n")
(moz-send-region (point-min) (point-max))))
@legumbre
legumbre / gist:2475206
Created April 24, 2012 01:03
swap control caps oneliner for live distro
setxkbmap -option ctrl:swapcaps
@legumbre
legumbre / leo-input-method.el
Created April 10, 2012 02:14
leo-input-method.el
;;; leo-input-method.el
(quail-define-package
"spanish-leo-prefix" "Spanish" "leo>" t
"My spanish input-method."
nil t nil nil nil nil nil nil nil nil t)
(quail-define-rules
("'a" ?á)
("'e" ?é)
("'i" ?í)
("'o" ?ó)
printf("%x xor %x = %x \n", a, b, a ^ b);
printf("%x xor %x = %x \n", a, res, a ^ res);
printf("%d - %d = %d (overflow: %d)\n", a, b, res, overflow);
printf("%x - %x = %x (overflow: %x)\n", a, b, res, overflow);
@legumbre
legumbre / gist:2232346
Created March 29, 2012 01:45
define a new style based on bsd, override c-basic-offset
(c-add-style "bsd-jimmy"
'("bsd" (c-basic-offset . 4)))
(add-to-list 'c-default-style '(c++-mode . "bsd-jimmy"))
@legumbre
legumbre / gist:2176240
Created March 23, 2012 23:16
magic-mode-alist and cc-other-file-list
;; 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
(lambda ()
@legumbre
legumbre / gist:2047402
Created March 15, 2012 22:35
cleaning macports
sudo port clean --all installed
sudo port -f uninstall inactive