-
Safety & Liquidity of Debt Mutual Funds
Yesterday I wrote an article about Debt Mutual Funds. I got a few questions about the liquidity and safety of a particular fund. So, I am adding a few more points. Many Debt Mutual Funds like Nippon, Axis and HDFC offer instant redemption and you get the money within 30 minutes. Safety of money means […]
-
FDs are destroying your wealth
If you are still making FDs of your monthly savings, you are destroying your wealth. Interest on FDs is taxable. That means the current interest rate of about 5.5% effectively gives you ~3.8% return on your money (Assuming you fall in the highest income tax slab). With more than 6% inflation, your money is losing […]
-
A useful tip to save upto Rs.15k in tax: Section 80TTB for Senior Citizens
As we are just 2 days away from the last date of filing income tax return, here is a useful tip to save upto Rs.15k in tax. If you are helping out a senior citizen in filing their Income Tax Return, do not forget section 80TTB which allows Rs.50k deduction on their interest income from […]
-
WordPress adding slashes in POST requests
WordPress adds slashes before quotes even if we do not want to use magic quotes. To solve this problem, you can use either of the following two functions on the values returned from POST requests- wp_unslash stripslashes_deep References: https://developer.wordpress.org/reference/functions/wp_unslash/ https://developer.wordpress.org/reference/functions/stripslashes_deep/ https://core.trac.wordpress.org/ticket/18322
-
How to disable translation pop-up on website in Google Chrome
Google Chrome on Android tries to show pages in user’s preferred language by continuously showing translation pop-up on each page load. This happens when website content is in a different language than user’s preferred language. But this creates issues in user experience by hiding bottom content on website. My site had fixed bottom navigation bar […]
-
How to Modify Title Tag in WordPress
I always missed a function to directly change the title tag in WordPress template. But here is a function which can do that for you. function modify_title( $new_title ) { add_action( ‘pre_get_document_title’, function( $current_title ) use( $new_title ) { return $new_title; }, 9999 ); } Please note that this function uses use keyword to bind […]
-
Restrict number of selected checkboxes in html
This code will restrict html multi select input to given number. document.addEventListener( “click”, function( event ) { if ( event.target.matches( ‘.input-checkbox’ ) ) { var inputCheckboxes = document.querySelectorAll( ‘.input-checkbox[type=”checkbox”]:checked’ ); if( inputCheckboxes.length > 3 ) { event.preventDefault(); alert( ‘You cannot select more than 3 categories for a post.’ ); } } } );
-
WP_Query by URL for Infinite Scroll in WordPress
I was trying to create an infinite scroll in WordPress. All I wanted was to parse the next page url without making any changes to the code so that the code becomes interoperable with the pagination templates. To achieve that, instead of passing custom query parameters to the API, I decided to parse the next […]
-
MySQL Disk Size Issue
I was facing a strange issue on one of my servers. Storage was getting full even when I did not upload any extra files. Turned out it was a MySQL logging issue and got resolved only when I disabled logging. References: https://www.christophe-casalegno.com/mysql-how-to-purge-binary-logs-when-you-have-no-space-left-on-device/ https://www.alittleofboth.com/2020/04/droplet-out-of-disk-space/ https://www.digitalocean.com/community/questions/where-did-my-disc-space-go
-
JPG Image Compression
When you upload images to Facebook or Whatsapp, you must have noticed a reduction in size and quality of the image. Though the image looks fine on most devices, its size get reduced by over 95%. The reason is compression. It is recommended to compress the images before uploading them to your blog or website. […]
-
Why click event not working on SVG
I created a simple menu with SVG icons and to my surprise, clicking on the icon was not taking me to the linked url. It turned out that as SVGs are independent HTML objects, the target element is actually nested path. So, it does not match with the clicked element and thus click event listeners […]
-
Add event listener on SVG element
I was facing problem while adding event listener to an svg element. Then I added event listeners to both svg and path tags, and it worked.
-
When my boss told me not to prepare for CAT
"Don’t prepare for CAT if you want to succeed here." Those were the words of the manager of my first project. I was a fresher B. Tech graduate in my first job and had joined my first project along with a few others. Our manager called us into his cabin for a casual introduction session. […]
-
Will electric cars ever succeed?
Many people think that electric cars cannot replace petrol cars due to high charging time and low battery capacity. Range anxiety is a big issue with electric cars today. This reminds me of the range anxiety of smartphone batteries we had just a few years ago. While traveling, we were always worried about whether our […]
-
Startups going back to the old models
Life comes full circle! Big EdTech startups who created so much hype about online education are returning to the offline coaching center model. Similarly, we are returning to the auto-rickshaws from the golden days of on-demand app-based cab services. Raising and spending investors’ money may be necessary for fast-paced growth, but it is equally important […]
-
Beauty of randomness in life
I do not mean to offend anyone but lately I have observed a peculiar trend in my LinkedIn feed. A lot of people are posting random stories about small instances from their daily life and trying to create analogies with something meaningful to bring out great learnings out of that. To be honest, sometimes these […]
-
Reolved failed upload in WordPress post edit filter
When adding an upload form to the post edit screen in WordPress admin, I found the upload to fail. The $_FILES array was empty.The reason was that by default, WordPress post edit form does not send files data. To fix that, we need to add enctype attribute to the form.Here is the code to do […]
-
How to customize PHP error message in WordPress
WordPress displays a default error message when it encounters a PHP error- There has been a critical error on this website. Learn more about troubleshooting WordPress. Now this message is subtle, but still reveals 2 things- Your website has some error Your website is built on WordPress Now second point is usually fine unless you […]
-
How to change custom post permalink in WordPress
I have struggled with this issue for years. I tried different ways but they always felt like hacks and gave inconsistent results most of the time. I also tried a popular plugin which broke my site. Whenever you add a custom post type in WordPress through code, there is no way to select a permalink […]
-
WordPress: Missing canonical tags on archive pages
WordPress keeps surprising me even after more than a decade since I started using it. Today I came to know that WordPress only generates canonical tags for singular pages (posts & pages). WordPress does not add canonical tags to archive pages including author page, post type archives, taxonomy archives etc. So, how to add canonical […]