Skip to content

Instantly share code, notes, and snippets.

@viktorklang
viktorklang / exclude_targetdirs.sh
Last active May 14, 2018 07:39
Adds all your sbt target dirs as path excludes for Time Machine
#WARNING: Use at your own risk. No warranties expressed or implied. YMMV. Drive responsibly. Eat healthy.
#First, `cd` into the parent dir for all of your `sbt`/`maven` projects (I assume you have one of those)
find "$(cd ..; pwd)" -type d -name "target" -print0 | sudo xargs -0 tmutil addexclusion -p
@jroper
jroper / Global.scala
Last active December 20, 2015 19:38
Transparent HEAD request handling in Play 2.1. Note that it may be more efficient to implement HEAD support in an action directly, as this may avoid unnecessary opening of resources or rendering things.
import play.api.libs.iteratee.{Done, Iteratee, Enumerator}
import play.api.mvc._
import play.api._
import play.api.libs.concurrent.Execution.Implicits._
object Global extends GlobalSettings {
override def onRouteRequest(req: RequestHeader) = {
// Lookup handler
super.onRouteRequest(req) match {
@msmith
msmith / couchdb-ec2-install.sh
Created August 25, 2011 17:26
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"