Skip to content

Instantly share code, notes, and snippets.

View casperc's full-sized avatar

Casper Clausen casperc

View GitHub Profile
(ns lein-headless
(:require [ccw.e4.dsl :refer [defcommand defhandler defkeybinding]]
[ccw.e4.model :refer [context-key]])
(:import [ccw.launching ClojureLaunchShortcut]))
(defn run
"Try to start a Leiningen Project. If focus is on a ClojureEditor, then first
try to launch from the editor project, else try to launch from the selection."
[context]
(let [editor (context-key context org.eclipse.ui.IEditorPart)]
# Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@casperc
casperc / joda-transit.clj
Last active December 2, 2015 14:36
Joda DateTime handler for Transit
;; Adds support to Transit for emitting Joda DateTimes in the same format as standard java.util.Date.
;; Dependencies: [clj-time "0.9.0"] and [com.cognitect/transit-clj "0.8.259"] (newer version will likely still work)
(require '[cognitect.transit :as transit])
(require '[clj-time.coerce :as coerce])
(import '[java.io ByteArrayOutputStream])
(def ^:private joda-time-verbose-handler
(transit/write-handler

Keybase proof

I hereby claim:

  • I am casperc on github.
  • I am casperc84 (https://keybase.io/casperc84) on keybase.
  • I have a public key ASCtdt8xOnRumSnFTWDK-sCcxsEKFsh_Dw3x06YcCgTxQQo

To claim this, I am signing this object: