elixir Programming

Setup React with Phoenix 1.4

Phoenix 1.4 uses webpack by default for asset management. This is how you can get up and running with React –

  • Go to assets directory
  • Run “npm install -S react react-dom”
  • Then, run “npm install -D @babel/preset-react”
  • Edit the .babelrc file. It should have
    "presets": ["@babel/preset-env", "@babel/preset-react"]

That’s it. Now, edit app.js file under assets/js –

import React from "react";
import ReactDOM from "react-dom";
class Hello extends React.Component {
render ()
return "Hello React" ;

var mountNode = document.getElementById("app");
ReactDOM.render(, mountNode);

And, finally edit app.html.eex and add a div tag with id=”app”.

Run mix.phx server and checkout http://localhost:4000. You should see “Hello React”!


MAMI Film Festival, 7 days, 25 films

First the unexpected experience. On October 25th at 8 a.m. I logged into Bookmyshow and registered for Mard Ko Dard Nahi Hota. And then it happened. Bookmyshow crashed. Twitter was abuzz, some angry, some losing patience. I decided to go to the theater and book for the rest of shows for day 1. It worked!

Now the films which did not impress me much – The Day I Lost My Shadow and Island of the Hungry Ghosts. The former is a film based during 2012 war in Syria. The film grabs your attention initially; showing a son and mother trying to make best of the situation. But as the protagonists go out in search of a gas cylinder the film becomes cryptic; dialogues felt vague and I lost interest. The latter is a film about how asylum seekers are placed on an isolated island by the Australian government. The protagonist, a trauma counselor, listens to various stories. We see her family life and the great migration of red crabs. But the way the film unfolds is unconvincing. But this documentary has got great reviews and awards!

Recently, I read, Naseeruddin Shah say

People should know what the India of 2018 was like. The only serious function films can serve is to act as a record of their times.

So, some of the films which performed this duty so well were –

  • Soni
  • – The film opens with a woman walking alone in a dimly lit lane and is harassed by a guy on bicycle. Soon, we come to know she is Soni, a police office. Her boss is also a woman officer. The film depicts their struggle.

  • The Hieresses
  • – A film from Paraguay where hardly 2-3 films are made every year. Its about 2 woman who have fallen on hard times.

  • Leave without Trace
  • – Why does a father decide to live in a forest with her daughter? What happens when they are forced to live among people? Should a parent decide whats best for their children?

  • Woman at War
  • – In the name of development, governments in this world justify environmental degradation. What can an ordinary citizen do ?

  • And breathe normally
  • – We think of Iceland as this beautiful country. But, there are people struggling to make a living.

The screening of One cut of the dead brought the house down.