Skip to content
/ Notes Public

Notes and other junk drawer artifacts from our meetups.

Notifications You must be signed in to change notification settings

Seajure/Notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published