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
(def FileChangeCallbacks (atom [])) | |
(defn on-file-changes | |
[changes] | |
(sync-user-dirs!) | |
(doseq [callback (seq @FileChangeCallbacks)] | |
(try (callback changes) | |
(catch Throwable t | |
(println "Exception in boot watch callback: " t)))) | |
(reset! last-file-change (System/currentTimeMillis))) |
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
;; Datomic example code | |
;; Demonstrates using datalog with Clojure defrecords | |
(use '[datomic.api :only [q db] :as d]) | |
;;; http://www.lshift.net/blog/2010/08/21/some-relational-algebra-with-datatypes-in-clojure-12 | |
(defrecord Supplier [number name status city]) | |
(defrecord Part [number name colour weight city]) | |
(defrecord Shipment [supplier part quantity]) | |
;; sample data |
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
(ns favila.async-util | |
"Some missing pieces of core.async. | |
as-transducer: Make a transducer function easily without Clojure 1.7. | |
go-pipe: async/pipe, but returns the go-loop. | |
fast-pipeline-blocking: faster than async/pipeline-blocking, but unordered results. | |
blocking-consumer: consume a channel with multiple worker threads." | |
(:require [clojure.core.async :as async | |
:refer [go go-loop <! >! <!! >!! close! take! put! chan]])) |
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/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |