React Tools Create React App React Dev Tools Storybook React Style guide generator Material UI Create React App Easiest way to get started with React. It comes in bundled with everything you need to start a React project without doing all the configuration grunt work. Follow the steps from here. React Dev Tools This is … Continue reading React Tools
React Best Practices
React Best Practices Container and View components a.k.a. Smart and Dumb components Higher Order Components Controlled Components A component should be an self contained module Create a wrapper 3rd party components Use propTypes and defaultProps When updating state, always use prevState Container and View components a.k.a. Smart and Dumb components This by far my favorite … Continue reading React Best Practices
Testing React
Testing React Intro Basic test (test state and props) Testing user interaction Testing whether a class method is called or not Things to remember Intro I am assuming you already have a testing environment set up with all the tools installed: karma + webpack and enzyme. If not, these are good resources: How to test … Continue reading Testing React
Running React
Running React The hard way - without create-react-app The easy way - with create-react-app Babel Terms to know Webpack Loaders Environment Running webpack The hard way - without create-react-app Create a node project: npm init -y Install react and react-dom: npm install react react-dom You will need atleast two files: a js file for your … Continue reading Running React
React Core
React Core Dissecting the building block of React: A Component Defining a component Using a component Types of component Functional Component Component Lifecycle Dissecting the building block of React: A Component The whole idea behind React is modularization and reusability. React components are the building blocks of this modularization. The idea is simple: you encapsulate … Continue reading React Core
Brushing up on React
Brushing up your React skills If you are like me, then chances are good that your React skills and knowledge gets rusty if you are not constantly working with it. If not, kudos to you! I tend to forget things a lot and therefore have to review them every time I come back. This is … Continue reading Brushing up on React
Why do you remember some movie quotes and not others?
Why are some movie quotes indefinitely etched in your brain and not others? What makes them more memorable? Are there any intrinsic semantic patterns that makes them memorable? These are the questions that Danescu-Niculescu-Mizil et al. posits in their paper "You had me at hello: How phrasing affects memorability". The premise of the paper is … Continue reading Why do you remember some movie quotes and not others?
Netflix Million Dollar Challenge: Understanding the algorithm that won a million dollar.
Providing recommendations is ubiquitous for a variety of products and services. One prime example is Netflix. In 2006, Netflix made an open challenge to data scientists world wide: improve their existing recommender system by 10%, win a million dollar. They opened a huge training and test data set for data scientists to use. Koren et … Continue reading Netflix Million Dollar Challenge: Understanding the algorithm that won a million dollar.
Understanding DB indexes
Interviewer: What is an index? Interviewee: Umm, it's the thing you do in your databases to make queries faster…. Ring a bell? That was the depth of my knowledge about indexes. I decided to learn more when one of my colleague shamed me into doing it. I came across Mark Winand's "Use the index, Luke!", … Continue reading Understanding DB indexes
Why can’t I do anything?
Seriously, why? Every night, before falling asleep, I make a mental list of things that I will accomplish the next day. And then I do none of them. I am on a very weird sleep schedule as I am working remotely from home, living in Bangladesh and working in Eastern Time, meaning I go to … Continue reading Why can’t I do anything?