- UI Engineer-1 at Flipkart.
- Ex-Algorithms Engineer, Android Developer. I am passionate about frontend, 3D tech and designing. This blog is to share my learning journey, and interesting things I found along my way.
Optimizing Graphs for Spreadsheet Formulas Evaluation
Cells in a spreadsheet can form a chain of interdependent formulas, where a change in one cell triggers the reevaluation of the entire chain. For example, in the example below, changing cell A1 or B1 recomputes C1, which recomputes C2 and D1. A B C D 1 4 5 =A1+B1 =B1+C1 2 =C1 + 1 =C2 + 1 I’ll explain how Fortunesheet handles this by using Topological Sorting, and how I optimized its performance by 82%. ...

A Bottom-up Approach to Async Modals in React
In React, you can use combination of Context and custom hooks to implement async modals. Async modals let you capture the response from modal asynchronously, saving the hassle of managing another state and improves readibility. Let’s try to build it from the ground up: 1. Bare bones App.js function App() { const [isModalOpen, setIsModalOpen] = useState(false); const onResponseClick = (response) => { setIsModalOpen(false); console.log(response); }; return ( <div> {isModalOpen && <Modal onResponseClick={onResponseClick} />} <button onClick={() => { setIsModalOpen(true); }} > Open Modal </button> </div> ); } To get the response (yes/no) from the modal, App component is forced to manage isModalOpen state and include <Modal /> component in its JSX. We know there is a better way to manage this by using Context. ...
⇧⇩ FortuneExcel - Lessons from my First Package
I revived an archived project and released it as FortuneExcel - a plugin for FortuneSheet to import/export Excel (.xlsx) files. Initialization Reviving the project meant fixing the deprecated code and existing bugs. Along with this, I added export feature, toolbar plugin support for fortune-sheet and set up Github workflow. Modularization While implementing a package, it should have maximum abstraction. User should have to add minimal code to their environment for your package to work, all while having no side-effects on their existing code. A proper code strucrure also makes it easier for others to contribute to your code. ...

Seamless View Switching Algorithm for ArcRotateCamera in Babylon.js
I’ll describe how I derived an algorithm to switch seamlessly between perspective and orthographic views. The solution will be implemented in babylon.js. Basics (the why) A camera can be controlled by 3 operations - pan, zoom and orbit. These operations in arcRotateCamera are performed by changing the following properties: camera position (where the camera is at) camera target (where the camera is looking at) More about how it works here. Consider using only these two properties to perform the operations. Although pan and orbit changes are reflect in both the views, zoom doesn’t seem to have any effect in orthographic view (see why?) ...