Skip to content

Instantly share code, notes, and snippets.

View gertverhoog's full-sized avatar

Gert Verhoog gertverhoog

View GitHub Profile
@gertverhoog
gertverhoog / gist:3826051
Created October 3, 2012 09:31
a simple Clojurescript logging function that prints objects with pr-str when appropriate
(defn- printable?
"Returns true if obj is printable with pr-str, false otherwise.
the function `log` uses this"
[obj]
(try
(satisfies? IPrintWithWriter obj)
(catch js/Error e
(satisfies? IPrintable obj))))
(defn log [& more]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clojure, Paredit and nRepl
;;
;; Sets up nrepl/clojure/paredit with the following features:
;;
;; - enable Paredit mode for clojure files
;;
;; - when there's an nrepl connection, compile and load clojure files
;; automatically after saving
;;
; <<>> DiG 9.6-ESV-R4-P3 <<>> ANY www.cmake.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35909
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0
;; QUESTION SECTION:
;www.cmake.org. IN ANY
;; ANSWER SECTION:
@gertverhoog
gertverhoog / gist:1526366
Created December 28, 2011 04:48
cmake.rb formula
require 'formula'
class Cmake < Formula
url 'http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz'
md5 '2147da452fd9212bb9b4542a9eee9d5b'
homepage 'http://www.cmake.org/'
bottle 'https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.6-bottle.tar.gz'
bottle_sha1 '3d8368605477bddc138872053f183ba52a6e4ec9'
def install
@gertverhoog
gertverhoog / gist:1526128
Created December 28, 2011 03:53
brew install -vd cmake (version 2.8.6, with manually changed md5)
$ brew install -vd cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
File already downloaded in /Users/gert/Library/Caches/Homebrew
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man
./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man
Error: #<BuildError: Failed executing: ./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man>
/usr/local/Library/Homebrew/formula.rb:541:in `system'
/usr/local/Library/Formula/cmake.rb:29:in `install'
/usr/local/Library/Homebrew/build.rb:74:in `install'
/usr/local/Library/Homebrew/formula.rb:273:in `brew'
@gertverhoog
gertverhoog / gist:1526119
Created December 28, 2011 03:50
brew install -vd cmake (version 2.8.6)
$ brew install -vd cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
/usr/bin/curl -qf#LA Homebrew 0.8.1 (Ruby 1.8.7-249; Mac OS X 10.6.8) http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz -o /Users/gert/Library/Caches/Homebrew/cmake-2.8.6.tar.gz
######################################################################## 100.0%
Error: MD5 mismatch
Expected: 1aa101f21050cc70b307f8cb50e9ff0c
Got: 0718f5a12e9d719226ef085dde981832
Archive: /Users/gert/Library/Caches/Homebrew/cmake-2.8.6.tar.gz
(To retry an incomplete download, remove the file above.)
/usr/local/Library/Homebrew/formula.rb:622:in `verify_download_integrity'
@gertverhoog
gertverhoog / gist:1526114
Created December 28, 2011 03:48
brew versions cmake
$ brew versions cmake
2.8.6 git checkout fa57b42 /usr/local/Library/Formula/cmake.rb
2.8.5 git checkout 311d28f /usr/local/Library/Formula/cmake.rb
2.8.4 git checkout 472c05b /usr/local/Library/Formula/cmake.rb
2.8.3 git checkout 93a9e5b /usr/local/Library/Formula/cmake.rb
2.8.2 git checkout c531c7a /usr/local/Library/Formula/cmake.rb
2.8.1 git checkout 7ebf57b /usr/local/Library/Formula/cmake.rb
2.8.0 git checkout 3c9bf69 /usr/local/Library/Formula/cmake.rb
2.6.4 git checkout a82e823 /usr/local/Library/Formula/cmake.rb
2.6.3 git checkout 905f31e /usr/local/Library/Formula/cmake.rb
$ brew install -vd cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
File already downloaded in /Users/gert/Library/Caches/Homebrew
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man
./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man
Error: #<BuildError: Failed executing: ./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.6 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man>
/usr/local/Library/Homebrew/formula.rb:541:in `system'
/usr/local/Library/Formula/cmake.rb:29:in `install'
/usr/local/Library/Homebrew/build.rb:74:in `install'
/usr/local/Library/Homebrew/formula.rb:273:in `brew'
$ brew install -v cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz
File already downloaded in /Users/gert/Library/Caches/Homebrew
Error: MD5 mismatch
Expected: 2147da452fd9212bb9b4542a9eee9d5b
Got: 0718f5a12e9d719226ef085dde981832
Archive: /Users/gert/Library/Caches/Homebrew/cmake-2.8.6.tar.gz
(To retry an incomplete download, remove the file above.)
zsh: exit 1 brew install -vd cmake