Сообщения

Мало того, что управление зависимостями в Rails то еще занятие, но упражнение по сборке бандла под Docker Alpine вообще за границами добра и зла. не libmysql-dev, блеать, а libmariadb-dev. и так далее
вот такие ментальные упражнения в маппинге DSL на SQL запросы просто демотивируют использовать рельсы и джемы https://stackoverflow.com/questions/42288875/constructing-an-activerecord-with-nested-joins-rails-4

Это пять!

А-а-а! "There is a gem for exevrything" rails mantra seems to be true! I've a problem assets precompilation in docker environment, and here is solution! Null DB Active record driver. Awesome! Meet the gem, that solves the problem, which should not exist at all! http://blog.zeit.io/use-a-fake-db-adapter-to-play-nice-with-rails-assets-precompilation/

clojure handy tips

use cond-> when you need to add optional parameter, like this (let [x 2]   (cond->  {:a 1}   (= x 2)  (assoc :b 2})) result will be {:a 1 :b 2}
what to do, when clojure map contains reserved kewords, like :@number? it's ok, in code you can use (keyword "@number") and be happy with that, but what to do to serialize map, or, when you need it as sample data for tests? in that case you can use clojure.walk (clojure.walk/stringify-keys m) and after that (clojure.walk/keywordize-keys m)

clojurescript and google closure compiler

I've just discovered joy of the Google Closure compiler, just when I've turned on warnings on infer when I started to get awkward errors upon javascript execution on minified CLJS. First, I've changed all (.-prop entity) to (goog.obj/get entity "prop") (.. % -target -value) to (goog.obj/getValuesByKey entity "target" "value") which is, as for me is more concise and crisp. Then, Delay class is much more clear and convenient then setInterval function. (.FileReader reader) was replaced by (goog.fs/FileReader.). "onload" event handler has been replaced by (.listen reader goog.fs/FileReader.EventType.LOAD_END) So, my code become much more clean and maintainable.