Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
@leedm777
leedm777 / ssh.config
Created November 9, 2010 21:04
My typical SSH config file
# This goes in ~/.ssh/config.
# ssh is picky about file permissions, so be sure to
# chmod 700 ~/.ssh
# chmod 600 ~/.ssh/config
#
# Forward X11 and ssh-agent to trusted hosts. Be sure to only do this for
# *trusted* machines, otherwise you may fall victim to identity theft.
# See ssh man page for details.
#
@leedm777
leedm777 / mcpp-fix-stpcpy.patch
Created November 8, 2010 21:57
Homebrew patch. Fixes MCPP compilation on Mac.
stpcpy is a #define on Mac OS X. Trying to define it as an extern is invalid.
diff -ur mcpp-2.7.2-orig/src/internal.H mcpp-2.7.2/src/internal.H
--- mcpp-2.7.2-orig/src/internal.H 2008-08-27 08:01:16.000000000 -0500
+++ mcpp-2.7.2/src/internal.H 2010-11-08 15:53:38.000000000 -0600
@@ -557,6 +557,6 @@
#endif
#endif
-#if HOST_HAVE_STPCPY
@leedm777
leedm777 / collatz.clj
Created March 9, 2010 14:57
Collatz algorithm in Scala and Clojure
(defn
#^{:doc "Clojure code to compute a Collatz sequence."}
collatz [n]
(if (= n 1)
'(1)
(cons n
(collatz (if (= (mod n 2) 0)
(/ n 2)
(+ (* n 3) 1))))))
/** Cute little function to take a random sample of a sequence. */
def randomSample(s:Seq[_]) = s filter { _ => util.Random.nextBoolean }