Anjanesh

HomeBadges
Blog Author Picture

Anjanesh Lekshminarayanan

UI Developer

Connecting MetaMask's web3 to a React app

Jan 11, 20211 min read

If you want your React app to connect to MetaMask's web3, const web3 = new Web3(window.web3.currentProvider);will no longer work as suggested. We need to MetaMask to authorize the connection which is a manual process by clicking on a button to author...

A form input & tabular output on the same page in Angular

Oct 29, 20205 min read

So, I have started learning Angular. I like it as it enforces OOPs concepts via TypeScript. Here I show how to input data into a form and display each entry as a row in a table. import FormsModule into app.module.ts import { FormsModule } from '@ang...

Number to words (crore and lakh)

Oct 19, 20209 min read

Number to words (Indian style - crore, lakh). The function is recursive. const HUNDRED = 100; const THOUSAND = HUNDRED * 10; const LAKH = THOUSAND * 100; const CRORE = LAKH * 100; function number2words(num) { let str = ''; if (num >= C...

One liner ES6 refactor

Oct 10, 20201 min read

How this function can be refactored to just one line ! This is a function returning a function that calls redux's dispatch() function manually. export const fetchUser = () => { return function(dispatch) { axios .get('/api/curr...

Form Validation Error Checking in JavaScript

Sep 2, 20202 min read

So, I was going through this video : https://www.youtube.com/watch?&v=4CeTFW4agRw - which talks about form validation in React, but is really general JavaScript form validation implemented in React. It has a line of code val.length > 0 && (valid = fa...

Returning amount of money in Indian ruppes to Crores / Lakhs / Thousands

May 28, 2020

<?php define('INR_THOUSAND', 1000); define('INR_LAKH', 100 * INR_THOUSAND); define('INR_CRORE', 100 * INR_LAKH); echo amountInINR(15000)."\n"; echo amountInINR(1500000)."\n"; echo amountInINR(150000000)."\n"; echo amountInINR(9876543210)."\n"; func...

© 2021 Anjanesh

PrivacyTerms
Proudly part of