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.

सपनें

बचपन में जो देखे थे सपनें
वह समय के साथ बह गए
अब कल जो देखे हैं सपनें
वह भी ख्वाब रह जायेंगे
क्या नहीं देखे सपनें ?
क्या जीवन सपनों के बिना अधूरा है ?

कुछ

इतना ज़हर मत दो की मैं तड़पता ज़िंदा रहूँ
इतनी दवा मत दो की मैं तड़पता मर जाऊ ॥

ज़हर

तुम्हारे दिल का जो ज़हर है,
इसका बहुत बड़ा कहर है
छोटी छोटी चिंगारियां उठती है,
जो मिलकर एक दिन सब भस्म कर देती है ॥

तरकी

इस शहर की तरकी को देखो,
बच्चों के सपनों को तरकी की ज़हरीली हवा में डूबता हुआ मत देखो
देश में अच्छे दिन है कुछ लोगों की मौत को मत देखो,
हमको क्या फर्क पड़े किसी और की दुनिया उजड़ने से हमारी इंसानियत का नकाब देखो ।।

अंत

हर सांस अंत की शुरुवात है
आखरी सांस ही अंत है
कोई सांस का हिसाभ है?
सिर्फ कर्मो की निशांनी रह जाती है
वह भी कुछ सालों में कहीं गुम हो जाती है
शायद कुछ निशान रह जाते है
पर उनका भी मतलब बदल जाता है
फिर कर्म क्यों?
फिर जीतने की तमना क्यों?

Tips from Mark Dvoretsky

From this wonderful interview –

But we mustn’t forget chess is also a sport and to be successful at a sport it is not enough to just have knowledge, you should have skills too. And for the development of skills you need to train

But it is not sufficient to only find what the student’s shortcomings are. It is also important to find out the reason why specific mistakes are being made

Conformism

A human who finished top 3 in a school is a school level conformist
A human who graduates from a top university is an educated college level conformist
A human who takes up a job at a large company with salary is successful capitalist conformist
A human who gets married achieves marriage level conformism
A human producing child is parent level conformist
A human who eventually dies is a human conformist

Quotes from The Children Of Men

The Children of Men is a story of a world with no children. What will be the world like if humans are unable to produce children anymore? Will the world become more miserable than it already is? The first part of the book was engaging but the second half becomes ‘too filmi’ when we are taken on a journey with the dissidents.

Bureaucracy

The petty bureaucrats of tyranny, men who relish the carefully measured meed of power permitted to them, who need to walk in the aura of manufactured fear, to know that the fear precedes them as they enter a room and will linger like a smell after they have left, but who have neither the sadism nor the courage for the ultimate cruelty.

Persistence

People have no persistence. They take up enthusiasms but quickly tire, particularly if their interest isn’t continually stimulated.

Idealism

The world is changed not by the self-regarding, but by men and women prepared to make fools of themselves.

Marriage

We live in the same house, but we’re like dodgers or guests in the same hotel.