Bower integration in play

If you want to use a package.json in your play application add the webjars dependency a package.json in root and the following in sbt , so you can access the javascript libraries. val bowerPath = SettingKey[String]("bower-path", "where bower is installed") lazy val bowerGenerateTaskImpl: Def.Initialize[Task[Seq[File]]] = (bowerPath, baseDirectory, streams) map { (bower, base, s) => try { Process("npm" :: "install" :: Nil) ! s.log Process(bower :: "install" :: "--allow-root" :: Nil, base) ! [Read More]

Lessons learned from Pieter Hintjens

The Confessions of a Necromancer is a professional road trip, written by Pieter Hintjens for his fellow programmers. He shares all the lessons that he learned in his life. Some of them are : Most of the time, most large software projects fail, and this is still true in 2016. The very notion of individual intelligence is a dangerously simplified myth. Technology is a slave to personality. You need to follow the money, and understand how it flows. [Read More]

Polymer

Useful resources

Architecture webcomponents Instant Loading Web Apps with An Application Shell Architecture this article describes the application shell Progressive Web Apps What is a Service Worker Promises PRPL pattern Service Worker Precache Service Worker resources The offline cookbook this is useful when working with Service Worker Precache to provide the best experience for your users. Service worker lifecycle is explained in the second chapter of the udacity course Offline Web Applications which explains how to use IndexedDB & Service Worker [Read More]

Akka Best Practices

Don’t share mutable state among actors Do not close on the sender Do not close over an actor’s context Do not use the scheduler with the Runnable trait Do not declare one actor within another. Never pass an actor’s this reference into Props Actors do not stop automatically when no longer referenced, every Actor that is created must also explicitly be destroyed. The only simplification is that stopping a parent Actor will also recursively stop all the child Actors that this parent has created. [Read More]

Free Monads

Resources on learning free monads

Here are some resources about the free monad in scala . At some point I need to write summaries for each entry :) Blog posts Free Monads I had bookmarked this sometime ago and seems to be very to the point without a lot of theotitical analysis Free Monad - Cats Documentation by Pascal Voitot herding cats - Free monads by Eugene Yokota Deriving the Free Monad by Noel Welsh [Read More]

Shapeless: Introduction resources

Where to start if you want to learn shapeless

Recently I decided to have a better look at shapeless, the generic programming library for scala. In the previous couple of years I had bookmarked several links and have recently read all of them . In this blog post I present the most useful ones for someone who want to be introduced to the library. The following blog posts are introductory to shapeless. Basically they are a smooth introduction to shapeless , something to warm up [Read More]

Shapeless : Computing deltas

A real life example

This is the code and some personal notes from the Shapeless? - Easy! talk where Valentin Kasas explains in a great way an advanced example of a real life use case (with slides). Computing deltas Imagine we want to be able to determine what are the difference between two objects of the same type For example, we need to know what have changed in our DB since the last backup We need to be able to compute such deltas over a wide variety of classes, that are unrelated Of course, doing this by hand for each and every class is not an option Our diff representation [Read More]

Play Framework - Beginner Tutorial : Make a post request and save the form data in Mongodb

Before the tutorial  You should : - read - Play Documentation : ScalaActions - Play Documentation : ScalaForms - Play Documentation : ScalaJsonAutomated - have basic understanding of scala future transformation (map, flatMap) - have basic understanding of scala implicits - clone play2.5-skeleton-compileDI. This example uses compile-time dependency injection. You can use run-time DI if you feel confident about it. - download and install mongodb (brew install mongo for mac or check the video) - download and install mongochef [Read More]

Scala libraries

Whenever I come I across a Scala library I take a note of it here. This collection is neither complete nor have I used all of these libraries. It is mainly used as a point of reference if I want to find some functionality implemented in a Scala library. AI bloom-filter-scala an efficient bloom filter for Scala doc neuroflow lightweight library to construct, sketch, train and evaluate Artificial Neural Networks [Read More]