Skip to content

Instantly share code, notes, and snippets.

@msgodf
msgodf / maximize-laptop.el
Created Feb 6, 2016
Function to maximize Emacs on my laptop display (Retina MacBook Pro 13", scaled for maximum space)
View maximize-laptop.el
(defun maximize-laptop ()
"Resize to fill my laptop display, and hide menu bar"
(interactive)
(setq ns-auto-hide-menu-bar t)
(set-frame-position nil 0 -22)
(set-frame-size nil 1660 1046 'pixelwise))
@msgodf
msgodf / condition-systems.md
Created Dec 15, 2015
Condition Systems in an Exceptional Language by Chris Houser
View condition-systems.md

Condition Systems in an Exceptional Language by Chris Houser

I recently watched Chris Houser's talk from Clojure/conj 2015 on condition systems in Clojure. I enjoyed the subject, so I decided to write up the talk as a way of encouraging me to really understand it, and in the hope that it might help others understand it.

The last time I heard about Common Lisp's condition system was at a talk by Didier Verna at ACCU in Bristol in 2013 (slides here). It sounded really interesting, but I didn't understand it well enough.

tl;dr

Chris Houser talks about different ways of handling errors in Clojure. Based on examples from Peter Seibel's book, Practical Common Lisp, he describes condition systems, which are also known as resumable exceptions, or restarts.

View podcasts.md
@msgodf
msgodf / alerting.md
Created Oct 13, 2015
"My Philosophy on Alerting" - Rob Ewaschuk
View alerting.md

My Philosophy on Alerting based my observations while I was a Site Reliability Engineer at Google

Author: Rob Ewaschuk rob@infinitepigeons.org

Introduction Vernacular Monitor for your users Cause-based alerts are bad (but sometimes necessary) Alerting from the spout (or beyond!)

@msgodf
msgodf / kiczales-oopsla94-black-boxes-reuse.md
Last active Dec 14, 2020
Gregor Kiczales "Why are black boxes so hard to reuse?"
View kiczales-oopsla94-black-boxes-reuse.md

This talk was given by Gregor Kiczales of Xerox PARC at OOPSLA ’94, 10/26/94. © 1994, University Video Communications. A transcript, with point- and-click retrieval of the slides, is available at http:/www.xerox.com/PARC/spl/eca/oi/gregor-invite/gregor- transcript.html

Why are black boxes so hard to reuse?

I think our field will go through a revolution. We will fundamentally change the way we think about and use abstraction in the engineering of software.

The goal of this talk is to summarize the need for and the basic nature of this abstraction framework.

The change is not new problems or new systems, but a new way of thinking about existing problems and existing systems.

@msgodf
msgodf / profiles.clj
Created Jul 30, 2015
My .lein/profiles.clj
View profiles.clj
{:user
{:plugins [[lein-try "0.4.3"]
[lein-ring "0.9.6"]
[lein-ancient "0.6.7"]
[lein-kibit "0.1.2"]
[refactor-nrepl "1.2.0-SNAPSHOT"]
[cider/cider-nrepl "0.10.0-SNAPSHOT"]
[lein-cljfmt "0.2.1"]
[jonase/eastwood "0.2.1"]
[lein-typed "0.3.5"]]
@msgodf
msgodf / gist:b108c0c79f5245fa3f30
Created Jul 8, 2015
Understanding how lists get destructured as maps in Clojure
View gist:b108c0c79f5245fa3f30
;; @andrew_jones mentioned this from Miller and Vandgrift's Applied Clojure book
;; unusual how the varargs were being destructured as if they were a map
((fn [& opts] (let [{:keys [a b c]} opts] (str a b c))) :a 1 :b 2 :c 3);;=>"123"
;; opts is a list, not a vector
(let [{:keys [a b c]} '(:a 1 :b 2 :c 3)] (str a b c));;=>"123"
(let [{:keys [a b c]} [:a 1 :b 2 :c 3]] (str a b c));;""
(let [{:keys [a b c]} [[:a 1] [:b 2] [:c 3]]] (str a b c));""
@msgodf
msgodf / gethostnames.sh
Created Jun 21, 2015
Get host names of any machines connected to my local network
View gethostnames.sh
#!/bin/bash
for i in $(seq 255);
do
nslookup 192.168.1.$(echo $i) 192.168.1.1 >/dev/null;
if [ $? -ne 1 ];
then
echo -n 192.168.1.$i;
nslookup 192.168.1.$(echo $i) 192.168.1.1|grep name|cut -d= -f2;
fi;
done
View gist:888d90bb90b94d87d5bf
[alias]
st = status
lg = log
ci = commit -v
co = checkout
br = branch
# View stash diffs - use n to go to the next stash and N to go to the previous stash
stp = "!IFS=$'\n';for stash in $(git stash list);do echo $stash;echo;git --no-pager diff --color=always $(echo $stash|cut -f1 -d:);done|less -pstash"
@msgodf
msgodf / euroclojure-2015-talks
Last active Aug 29, 2015
EuroClojure 2015 talks
View euroclojure-2015-talks
https://twitter.com/pyr "talking about #mesos and mesomatic: the cluster is a library"
https://twitter.com/AdamTornhill "Beyond Code: Repository Mining with #Clojure"
https://twitter.com/kachayev "Reinventing Haxl: Efficient, Concurrent and Concise Data Access"
https://twitter.com/ifesdjeen "Clojure is a sweet spot for Analytics"
https://twitter.com/mtrimpe "building Elephant 2000, McCarthy’s programming language for 2015, using Clojure"