Seajure / Notes

Notes and other junk drawer artifacts from our meetups.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seajure Meetup Notes

Intro

These are notes from our meetups. If we talk about a good tool or library, I’ll try and add a link here. Feel free to add your own notes.

February 2015

We tried to create a simple web application that echo’s messages (dare I say, a “twitter clone”?…well, not even close, actually.)

Code is at https://github.com/Seajure/echo.

Below is a snippet I saved from an earlier attempt:

(defonce hollas (atom []))

(defn layout [title & body]
  (html5
   [:head
    [:meta {:charset "UTF-8"}]
    [:title title]]
   [:body
    [:div.container {}
     body]]))

(defn holla-form []
  (form/form-to [:post "/"]
                (form/label "holla" "What do you want to holler?")
                (form/text-area "holla")
                (form/submit-button "Holla!")))

(defn display-hollas [hollas]
  [:ul
   (for [holla hollas]
     [:li {} holla])])

(defn index []
  (layout "Holla"
          (holla-form)
          [:div {:class "clear"}]
          (display-hollas @hollas)))

(defn add-holla [holla]
  (swap! hollas conj holla)
  (index))

(defroutes routes
  (GET "/" [] (index))
  (POST "/" [holla] (add-holla holla)))

(def app (handler/site routes))

(defn start [port]
  (ring/run-jetty app {:port port :join? false}))

(defn -main []
  (let [port (Integer. (or (System/getenv "PORT") "8080"))]
    (start port)))


March 2015

We’re planning on going over Marcus M’s Star Trek port.

Links

About

Notes and other junk drawer artifacts from our meetups.


Languages

Language:ApacheConf 100.0%