Skip to content

Instantly share code, notes, and snippets.

View podviaznikov's full-sized avatar
🗽
NYC, hacking, thinking, observing, feeling

anton podviaznikov

🗽
NYC, hacking, thinking, observing, feeling
View GitHub Profile
@podviaznikov
podviaznikov / big-o-links
Last active December 17, 2015 23:48
Some links with Big O related information and algorithms articles in general
@podviaznikov
podviaznikov / clojure-require-https.clj
Created May 17, 2013 04:57
how to force https traffic in clojure web app
(defn https-url [request-url]
(str (str (str (str "https://" (:server-name request-url) ":") "443")) (:uri request-url)))
(defn require-https
[handler]
(fn [request]
(if (= (:scheme request) :http)
(ring.util.response/redirect (https-url request))
(handler request))))
@podviaznikov
podviaznikov / clojure-logs-beanstalk.clj
Created May 15, 2013 05:33
to make clojure clojure.tools.logging work on amazon beanstalk past following code somewhere in the app. In case of ring/compojure project on top of handler.
(alter-var-root
#'clojure.tools.logging/*logger-factory*
(constantly (clojure.tools.logging.impl/jul-factory)))