Title / Description
Code (ns xx.views.welcome (:require [xx.views.common :as common]) (use noir.core hiccup.core hiccup.page-helpers) (:use somnium.congomongo) (:use [somnium.congomongo.config :only [*mongo-config*]])) (defn split-mongo-url [url] "Parses mongodb url from heroku, eg. mongodb://user:pass@localhost:1234/db" (let [matcher (re-matcher #"^.*://(.*?):(.*?)@(.*?):(\d+)/(.*)$" url)] ;; Setup the regex. (when (.find matcher) ;; Check if it matches. (zipmap [:match :user :pass :host :port :db] (re-groups matcher))))) ;; Construct an options map.
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code