Dev | Random thoughts

December 2, 2016

Managing dependant projects with leiningen

Caveat For some reason the nicely aligned clojure snippets are rendered weirdly. Probably some proportional/fixed width issue somewhere. Apologies. About I strongly believe that ignorance is one of the most powerful tools we should employ when we build software. As a mechanism to enforce de-coupling it is great. What?! Huh?! No, I haven’t lost the plot (any more than usual), I simply mean that I strive to build small components that are as ignorant as possible. ... Read more

November 11, 2016

Speeding up ClojureScript compilation

About If you are using ClojureScript (and if not, why not? :-)) then I *strongly* recommend you enable parallel build. I mistakenly thought this meant that it would run separate builds in parallel, but no, it is far cleverer and more useful than that, it builds a single build in parallel. Also, to be crystal clear, this isn’t going to do anything to your runtime performance, only the build time. ... Read more

November 10, 2016

Restricting helm and ag to certain files

ag is great and searches through your code base in the blink of an eye. Coupled with helm it makes for a great experience finding things. If run in a git project then it helpfully ignores those in your .gitignore file. However, in most projects I have files with different extensions, maybe some .md for documentation, some .html for published documentation, .clj, .cljs, .cljc, .js etc. I often know in which files the thing I am searching for lives, but I hadn’t figured out a way to restrict ag. ... Read more

October 6, 2016

Abstractions

dev
I see a lot of code bases getting into a mess through an inappropriate use of abstraction. Like many things in the Software Engineering industry, it is a tool which is in wide-spread use, learned from poor examples and not particularly well understood. For me, the best definition of an abstraction, and I apologise for not crediting whoever coined this phrase (_it may well have been me in my yuff :-) but I am pretty sure I read it somewhere_): ... Read more

September 29, 2016

Circle-ci and phantomjs

Another quick tip. I use the excellent cljsbuild to compile and test our ClojureScript projects (and I can’t believe how difficult it is to wire this stuff together in 2016!). To support continuous integration I use phantomjs to provide the JavaScript environment. Unfortunately circleci’s environment doesn’t have phantomjs v2 available to it and v1 has some troubling properties. It turns out, after much googling and dead ends, that it is pretty trivial to get phantomjs in your circleci environment, simply add: ... Read more

September 28, 2016

Keeping project buffers tidy with projectile

Projectile is an excellent library for managing ‘projects’ (where a project is typically a git repository). Today I found a new tip - projectile-kill-buffers which effectively removes the project from your current emacs session: projectile-kill-buffers is an interactive autoloaded compiled Lisp function in ‘projectile.el’. It is bound to SPC p k, M-m p k, C-c p k, <menu-bar> <tools> <Projectile> <Kill project buffers>. (projectile-kill-buffers) Kill all project buffers. [back] It is really useful if you are toggling between multiple projects and want to finish working on one of the projects. ... Read more

September 27, 2016

Git tagging your builds automatically

I need to write a much longer post to explain my thoughts on ‘versioning’ and what constitutes a release with today’s trends of continuous integration, but for now, a simple tip. I wanted a way to distinguish each build, not each release but each build. There is one excellent source of truth for that which is your git repository. Wouldn’t it be great if each build contained a full git log of what went into it? ... Read more

September 26, 2016

Lessons learned with Clojure's StackTraces

A hard day I learned the following lessons today: Simplest is best Evaluate your assumptions Sometimes development is just hard In a nutshell, our production app records UI errors and submits them to the server where they are pushed to the error-handler. Similarly, if an Exception is raised server side it is also pushed to the error-handler. However, the errors that had been captured were all ridiculously long stack traces with no references to any of my code. ... Read more

© Malte Kiefer 2016