Skip to content

Instantly share code, notes, and snippets.

View mtm's full-sized avatar

Mike T. Miller mtm

  • Sarasota, FL
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mtm on github.
  • I am forthdude (https://keybase.io/forthdude) on keybase.
  • I have a public key ASDY0uhMNp6NmGrmturO_l3MRzQinnp1N3A7jINgIcoOtwo

To claim this, I am signing this object:

[
{
"css": ".keylabel2 { color: #65dbdb;}\n.keylabel6 { color: #111111;}\n"
},
[
{
"c": "#adadad",
"t": "#000000\n#1e877d\n#b06e20",
"f": 2,
"fa": [
@mtm
mtm / gist:5045319
Created February 27, 2013 05:20
jabber config
;;;
;;; jabber stuff
;;;
(require 'jabber)
(setq jabber-account-list
'(("jinious@gmail.com"
(:network-server . "talk.google.com")
(:connection-type . ssl))))
@mtm
mtm / gist:2661471
Created May 11, 2012 18:16
alternate periodic function
(def ^{:dynamic true} *print-progress* true)
(defmacro defn-do-periodic [name args [var period] body]
`(let [counter# (atom 0)]
(defn ~name [~@args]
(swap! counter# inc)
(when (and *print-progress*
(zero? (mod @counter# ~period)))
(let [~var @counter#]
~body)))))
@mtm
mtm / progress.clj
Created May 11, 2012 18:08 — forked from kriyative/progress.clj
First cut implementation of `with-progress` and `report!`
(def ^{:dynamic true} *print-progress* true)
(defmacro with-progress
"Bind a `reportfn` function, and evaluate `body` wherein
calling (report!) will invoke the report function with the current
state of the iteration."
[reportfn & body]
`(let [iter# (atom 0)
reporter# ~reportfn]
(letfn [(~'report! []
(defun port-availablep (port)
(condition-case nil
(let ((p (make-network-process :name "port-checker" :buffer nil :host "localhost" :service port)))
(delete-process p))
(file-error t)))