Skip to content

Instantly share code, notes, and snippets.


Cameron Desautels camdez

View GitHub Profile
camdez / core.clj
Created Jul 30, 2017
Experimenting with extending Transit to truncate Doubles and Floats
View core.clj
(ns transit-ex-test.core
(:require [cognitect.transit :as transit])
(:import [ ByteArrayOutputStream]
(defn truncate-double [^Double d]
camdez /
Created Aug 24, 2016
Small Business App Showdown Leaderboard
# - Small Business App Showdown leaderboard
# Author: Cameron Desautels <>
# Date: 2016-08-24 13:09:48
curl $DATA_URL \
View map-table.clj
(defn table [cols vals]
(->> vals
(partition (count cols))
(map (partial zipmap cols))))
(defn table2 [cols & rest]
(map (partial zipmap cols) rest))
[:this :that :another]
camdez / breaktime.el
Last active Aug 29, 2015
/u/joeheyming's Emacs break timer (modified)
View breaktime.el
;;; See:
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-interval (* 3 60 60)
"How often to take a break, in seconds.")
(defun breaktime--take-a-break ()
(switch-to-buffer (get-buffer-create "*breaktime*"))
(let ((inhibit-read-only t))
camdez /
Last active Aug 29, 2015
Pairing Sessions

Remote Pairing Sessions

I’m open to pairing programming with anyone on anything. I’m interested in exposure to other people’s coding / problem solving styles, and I’m happy to share what I know. Need another pair of eyes on something? Leave a comment below, or email me at

camdez / experimental.el
Created May 6, 2015
Play sound in Emacs when mark is pushed. Interesting for discovering which commands push mark. (If not using OS X, insert appropriate sound file path.)
View experimental.el
;; $ ls /System/Library/Sounds/
;; Basso.aiff Bottle.aiff Funk.aiff Hero.aiff Ping.aiff Purr.aiff Submarine.aiff
;; Blow.aiff Frog.aiff Glass.aiff Morse.aiff Pop.aiff Sosumi.aiff Tink.aiff
(defun camdez/push-mark--play-sound (&optional location nomsg activate)
(play-sound-file "/System/Library/Sounds/Pop.aiff" 20))
(advice-add 'push-mark :after #'camdez/push-mark--play-sound)
camdez /
Last active Sep 16, 2020
Alan Perlis' "Epigrams on Programming"

Epigrams on Programming

Alan J. Perlis, Yale University

This text has been published in SIGPLAN Notices Vol. 17, No. 9, September 1982, pages 7 - 13. I'm offering it here online until ACM stops me.

The phenomena surrounding computers are diverse and yield a surprisingly rich base for launching metaphors at individual and group activities. Conversely, classical human endeavors provide an inexhaustible source of metaphor for those of us who are in labor within computation. Such relationships between society and device are not new, but the incredible growth of the computer's influence (both real and implied) lends this symbiotic dependency a vitality like a gangly youth growing out of his clothes within an endless puberty.

The epigrams that follow attempt to capture some of the dimensions of this traffic in imagery that sharpens, focuses, clarifies, enlarges and beclouds our view of this most remarkable of all mans' artifacts, the computer.

camdez / experimental.el
Last active Aug 29, 2015
Add new Emacs experiment
View experimental.el
(defun camdez/add-experiment ()
(find-file camdez/experiments-file)
(goto-char (point-min))
(re-search-forward ";;; Code:")
(insert "\n\n")
(insert ";; ")
(insert "\n\n"))
View longhorn-version.el
(eval-after-load 'projectile
'(add-hook 'find-file-hook 'camdez/warn-if-longhorn-version))
(defun camdez/warn-if-longhorn-version ()
(when (projectile-project-p)
(let* ((file-name (buffer-file-name))
(project-dir (projectile-project-root))
(views-dir (concat project-dir "app/views/"))
(lh-views-dir (concat project-dir "app/longhorn_views/")))
View melpa-stable-add.yasnippet
# name: Request Addition to MELPA Stable
# key: melpa-stable-add
# uuid: 2776fd13-47f6-4438-902e-2f39c48fd790
# contributor: Cameron Desautels <>
# --
[MELPA Stable]( is the new younger sibling of MELPA for users who'd rather run only stable versions of packages (MELPA can be a bit rocky since every commit comprises a new release), and it would be super cool if ${1:this package} could be installed via Stable.
Fortunately it's also really easy to support—all you have to do is define a tag in the \`v...\` format and you're done. I'd submit a PR if I could, but since tags are global to a project, that's not something possible via PR.
You can’t perform that action at this time.