Anjanesh

HomeBadges
Blog Author Picture

Anjanesh Lekshminarayanan

1 follower

UI Developer

Serving an image as a script

Feb 23, 20212 min read

A lot of times, we try to track user details by embedding an image in the email which is actually a script that does some logging before actually spitting out the image content. This is old-school. logo.php : <?php $IP = $_SERVER['REMOTE_ADDR']; $B ...

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...

© 2021 Anjanesh

PrivacyTerms
Proudly part of