This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-12
Channels
- # aleph (1)
- # aws (2)
- # babashka (44)
- # beginners (178)
- # biff (12)
- # calva (22)
- # chlorine-clover (60)
- # cider (1)
- # clj-kondo (9)
- # cljdoc (6)
- # cljs-dev (37)
- # cljss (2)
- # clojure (43)
- # clojure-europe (3)
- # clojure-finland (23)
- # clojure-italy (1)
- # clojure-nl (4)
- # clojure-norway (3)
- # clojure-spec (56)
- # clojure-uk (148)
- # clojuredesign-podcast (1)
- # clojurescript (11)
- # conjure (5)
- # core-async (22)
- # cursive (9)
- # datascript (5)
- # datomic (4)
- # duct (8)
- # emotion-cljs (2)
- # figwheel-main (15)
- # fulcro (53)
- # graalvm (68)
- # helix (2)
- # jackdaw (1)
- # kaocha (9)
- # lambdaisland (1)
- # malli (10)
- # meander (2)
- # news-and-articles (1)
- # observability (12)
- # off-topic (17)
- # pathom (1)
- # pedestal (25)
- # practicalli (1)
- # protojure (4)
- # re-frame (2)
- # reagent (57)
- # reitit (1)
- # releases (2)
- # shadow-cljs (69)
- # specter (6)
- # tools-deps (10)
- # vim (16)
- # vscode (4)
- # yada (3)
(defn start-system!
"Starts and returns a system"
[]
(let [config (config/load-from-classpath)
db (db/create-db-connection config)
server (server/start-server config db)
scheduler (jobs/create-scheduler)]
{:config config
:db db
:server server
:scheduler (doto scheduler
(.start))}))
(defn stop-system!
"Stops a system and closes down any resources"
[system]
(.close (:db system))
(server/stop-server (:server system))
(.shutdown (:scheduler system)))
;; Repl Use
(comment
(do
(def system nil)
(defn start! []
(alter-var-root #'system (fn [_] (or system (start-system!)))))
(defn stop! []
(alter-var-root #'system (fn [_] (if system
(stop-system! system)))))))
now this isn't nearly a "real" app, but personally it feels like the dependency arranging of system and co might be overkill for simpler cases
I'm looking for more plain-text based visualization languages/tools, examples being dot/graphviz and ditaa. I'm sure there are others out there but my google-fu is failing me.
created a #releases channel where people can share boring / minor / maintenance releases that do not contain lots of exciting stuff to be mentioned in announcements.
Hi, does someone have an example configuration of running clojure integration on gitlab with tools.deps? Or is there a docker container I can derive from that has the latest tools.deps installed?
Ok, I just found the official docker images https://hub.docker.com/_/clojure
Something where you are transforming common request data into response data without any annoying snowflake classes?
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
session['username'] = request.form['username']
return redirect(url_for('index'))
return '''
<form method="post">
<p><input type=text name=username>
<p><input type=submit value=Login>
</form>
'''
It's close, but I'd love it if there were something that uses dicts for the request data too so you don't have to research as many docs.
def wrap_login (next_handler):
def handler(request):
if request['method'] == "POST":
return {
"status": 301,
"session": {
"username": request["body"]["username"],
},
"headers": {
"Location": url_for("index")
},
}
request.update({
"headers": {
'Content-Type': "text/html",
},
"body": """
<form method="post">
<p><input type=text name=username>
<p><input type=submit value=Login>
</form>
"""
})
response = next_handler(request)
return response
return handler