Uncle Bob, you recently wrote a post titled Types And Tests. It generated quite a lot of buzz. It was also, in my opinion, a bit naive regarding the current state of affairs in type systems. This made it difficult for me to understand exactly what your points were and I would like to understand those better. To help clarify those I'm going to provide counter examples to your claims and propose other questions that both might help me better understand what you mean. Hopefully someone else finds this useful as well. I'll be using Ruby and Haskell for most code snippets as they are representative of the two sides and I'm most familiar with them right now.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
USAGE: | |
morphagene_ableton.py -w <inputwavfile> -l <inputlabels> -o <outputfile>' | |
Instructions in Ableton: | |
Insert locators as splice markers in your project (Create > Add Locator) | |
Export Audio/Video with | |
Sample Rate: 48000 Hz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(refer-clojure :exclude '[slurp spit]) | |
(import '[java.awt.datatransfer DataFlavor StringSelection Transferable]) | |
(defn clipboard [] | |
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
(defn slurp [] | |
(try | |
(.getTransferData (.getContents (clipboard) nil) (DataFlavor/stringFlavor)) | |
(catch java.lang.NullPointerException e nil))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vimrc | |
" Map leader to comma | |
let maplocalleader="," | |
" Toggle this for vim-sexp to not go into insert mode after wrapping something | |
let g:sexp_insert_after_wrap = 0 | |
" Toggle this to disable automatically creating closing brackets and quotes | |
let g:sexp_enable_insert_mode_mappings = 1 | |
Vocab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; add lein dep: | |
;; [org.bouncycastle/bcpg-jdk15on "1.51"] | |
;; export gpg public & private keys to armored files: | |
;; gpg -ao pub.asc --export XXXXXXXX | |
;; gpg -ao pk.asc --export-secret-keys XXXXXXXX | |
;; usage: | |
;; (encrypt "foo.txt" "foo.gpg" (pub-key "pub.asc")) | |
;; (decrypt "foo.gpg" (io/output-stream "foo.txt") (secret-key "ks-pk.asc") "passphrase") |
- This script: https://gist.github.com/guenter
- Launch a Mesos cluster on Google Compute: https://google.mesosphere.io
- Marathon docs: https://mesosphere.github.io/marathon/
- Marathon 0.7.0-RC2: http://downloads.mesosphere.io/marathon/v0.7.0-RC2/marathon-0.7.0-RC2.tgz
Please prefix apps with your name if you use the shared cluster
TLDR: I now add the following snippet to all my Dockerfiles:
# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
&& (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
&& (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
|| echo "No squid-deb-proxy detected on docker host"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'fog' | |
require 'zerigo_dns' | |
# A simple script to help you leave zerigo behind | |
# it relies on the excellent fog library http://fog.io/dns/ | |
# It copies all of your Zerigo zones to DNSimple | |
# It is currently targeting DNSimple but fog supports many other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
NewerOlder