Skip to content

Instantly share code, notes, and snippets.

View milkypostman's full-sized avatar
🏠
zzz

Donald Curtis milkypostman

🏠
zzz
View GitHub Profile
@milkypostman
milkypostman / gist:1679232
Created January 25, 2012 22:20
Emacs package.el fixes.
(defadvice package-compute-transaction
(before
package-compute-transaction-reverse (package-list requirements)
activate compile)
"reverse the requirements"
(setq requirements (reverse requirements))
(print requirements))
(defadvice package-download-tar
(after package-download-tar-initialize activate compile)
@milkypostman
milkypostman / gist:1679208
Created January 25, 2012 22:17
Fix for HTTP Keep-Alive in Emacs
(setq url-http-attempt-keepalives nil)
@milkypostman
milkypostman / gist:1679158
Created January 25, 2012 22:12
melba package line
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
@milkypostman
milkypostman / gist:1590067
Created January 10, 2012 17:13
weirdness?

Oh, No!

I'm afraid /keybinding-madness/#comment-19945 doesn't exist on brettterpstra.com. If it was here, and now isn't, that's my bad. I promise I'll make it up to you. Still friends?

Would any of these help?

  • [KeyBinding madness][2]
  • [A little KeyBinding sanity][3]
@milkypostman
milkypostman / markdown-mode+.el
Created October 27, 2011 20:10
markdown-mode additional functions.
(defun markdown-copy-html ()
"process file with multimarkdown and save it accordingly"
(interactive)
(save-window-excursion
(flet ((markdown-output-standalone-p () t))
(markdown))
(kill-ring-save (point-min) (point-max))))
(defun markdown-copy-rtf ()
"render and copy as RTF"
@milkypostman
milkypostman / shell-command-on-region-to-string.el
Created October 27, 2011 20:09
shell-command-on-region-to-string
(defun shell-command-on-region-to-string (start end command)
(save-window-excursion
(with-output-to-string
(shell-command-on-region start end command standard-output))))
@milkypostman
milkypostman / cleanup-markdown-lists.el
Created October 27, 2011 20:08
Cleanup markdown lists using elisp.
(defun markdown-cleanup-list-numbers-level (&optional pfx)
"Update the numbering for pfx (as a string of spaces).
Assume that the previously found match was for a numbered item in a list."
(let ((m pfx)
(idx 0)
(success t))
(while (and success
(not (string-prefix-p "#" (match-string-no-properties 1)))
(not (string< (setq m (match-string-no-properties 2)) pfx)))
@milkypostman
milkypostman / ghc-7.0.4-nowarnosx.patch
Created October 25, 2011 14:00
Patch for GHC 7.0.4 to avoid warnings when compiling.
--- ./ghc/ghc.wrapper.old 2011-10-25 08:57:34.000000000 -0500
+++ ./ghc/ghc.wrapper 2011-10-25 08:57:06.000000000 -0500
@@ -1 +1 @@
-exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"}
+exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -optl "-Wl,-read_only_relocs,suppress" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"}
@milkypostman
milkypostman / shell-command-region-to-string.el
Created October 13, 2011 03:51
Shell Command Function in Elisp
(defun shell-command-on-region-to-string (start end command)
(with-output-to-string
(shell-command-on-region start end command standard-output)))
@milkypostman
milkypostman / Date Time.textexpander
Created October 12, 2011 20:25
Date Time Snippets
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>groupInfo</key>
<dict>
<key>expandAfterMode</key>
<integer>1</integer>
<key>groupName</key>
<string>Date Time</string>