Skip to content

Instantly share code, notes, and snippets.

@gorsuch
gorsuch / graphite-client.clj
Created March 2, 2012 21:39 — forked from codification/graphite-client.clj
Graphite client in clojure
(ns clj-client.core
(import [java.net Socket]
[java.io PrintWriter]))
(defn now []
(int (/ (System/currentTimeMillis) 1000)))
(defn write-metric [name value timestamp]
(with-open [socket (Socket. "localhost" 2003)
os (.getOutputStream socket)]
@gorsuch
gorsuch / cookies.clj
Created July 25, 2011 21:29 — forked from ibdknox/cookies.clj
sessions and cookies
(require '[noir.cookies :as cookies])
(cookies/put! :user-id 2)
(cookies/get :user-id)
;; => 2
(cookies/get :username "anon")
;; => "anon"
;; you can also pass a map that has all the cookie's attributes