Skip to content

Instantly share code, notes, and snippets.

View ztellman's full-sized avatar
💭
boiling the ocean

Zach Tellman ztellman

💭
boiling the ocean
View GitHub Profile
@ztellman
ztellman / simple.clj
Created December 26, 2010 19:13 — forked from zoka/simple.clj
;;
(ns clojfix.simple)
(use 'gloss.core 'gloss.io)
(import
[java.nio
ByteBuffer])
(ns dining-service
(:use aleph.core)
(:use aleph.http)
(:use net.cgrand.moustache)
)
(defn report-handler [response-channel request]
(enqueue response-channel
{:status 200
:headers {"content-type" "text/plain"}
(ns scratchpad
(:use [aleph.core :only (siphon wrap-channel)]
[aleph.tcp :only (start-tcp-server)]
[aleph.formats :only (channel-buffer->string)]))
(defn echo-handler [channel connection-info]
(siphon (wrap-channel channel #(str "Response : " (channel-buffer->string %))) channel))
;; Returns function to stop the server
(def server (start-tcp-server echo-handler {:port 8080}))
(ns draw-order (:use [penumbra.opengl] [penumbra.window]))
(defn- init [state]
(enable :depth-test)
(ortho-view 0 0 640 480 -1 1)
(scale 1 1 -1)
state)
(defn draw-square [x y w h]
(draw-quads