Techlanes is started out as a surprise element and reached many readers mainly on the tips that are provided on Twitter. You can find twitter tips, blogging, a bit of SEO tips. The author of this blog is vickythegme Follow him on Twitter

3 May 2020

// // Leave a Comment

How to Remove console.log Messages From Any Application

Remove console log Messages

Being a developer often times we would find the need to write console log messages to debug the application that we write in JavaScript or any of it's frameworks.

More times that we can count, we tend to forget/ miss out removing the console statements that are written in our application. It could be either by one developer working on a small application or can be a team of developers working on a big application.

This post will help you suppress all the console log statements that are present in any application.

Let's take for example, that you have a JS file that performs some functionality in your application with some console log statements written in it. All you have to write is just a one liner at the top of the page.

window.console.log = function() {};

The above line would suppress all the console log statements and sent to a noop function that are written in your JS file. This can come very handy when you are pushing your files to production that will not print any console messages in your browser console.

This can even be written at your Node backend, if needed. Take this for example, you have a JS file that you are running in your node server by calling
node append.js

// File Name : append.js

function appendString(firstName, lastName) {
    console.log(`First Name is ${firstName}`);
    console.log(`Last Name is ${lastName}`);
    return `${firstName} ${lastName}`;

The above will print the two console log in your Node Terminal Console. So, to remove this, we will be adding a similar fix like the above to this append.js file.

Here's how it will look like

// File Name : append.js
console.log = function(){};
function appendString(firstName, lastName) {
    console.log(`First Name is ${firstName}`);
    console.log(`Last Name is ${lastName}`);
    return `${firstName} ${lastName}`;

We are not calling the window object here because that's not available at the server side. Window Object can be accessed at the client end.

We have to find one JS file that basically links all the other JS files in your application and write it on top of the file. This varies from application to application.

The above are just some simple examples, but I hope you get the idea as to where this line has to be put in your application.

For applications like Angular that has different environment setups, we can suppress the console logs specific to environments like only in production.

Here's how you can suppress the console log messages from an Angular Application. 
Drop your comments if this worked out for you or if there's a better way that you have found to do in your application.

Photo Credit. : Photo by Max Chen on Unsplash
Read More

5 Apr 2020

// // Leave a Comment

How To 301 Redirect From Non-WWW to WWW using .htaccess

301 Redirection

If you are a blogger or a developer who mostly works on blogs, websites, you will definitely have faced this situation to have the website with www prefix to your domain.

There's no official proof that having www prefixed to the domain has any improved SEO effects, yet I have seen most of the websites to have www domains compared to non-www domain.

Here's this post that will help you do a 301 Redirect from non-www to www domain using .htaccess file.

RewriteCond %{HTTP_HOST} ^$ [NC] 
RewriteRule (.*)$1 [R=301,L]

The above snippet of code will do a 301 redirection of the non-www url to www url.

Note : Replace with your domain name

Another way is to have a generic htaccess snippet of code to redirect the url from non-www to www.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

This piece of code will take up any domain url that's non-www and redirect to www domain.

Add either of the above code snippet to your website's .htaccess file

HTTPS urls can be redirected in the same way as above by replacing the http to https.

Let me know in the comments, if the above code snippet worked for you.

Pic Credit. : Unsplash
Read More

15 Mar 2020

// // 1 comment so far

How to Upload ads.txt file to Blogger - Adsense

This post is going to help people who have Adsense enabled to their blog and are using Blogger Platform for Blogging.

I was recently browsing through my Adsense account after some period of time and I could find an alert notification that's here in the picture below.

I updated the ads.txt to this blog as I'm running this blog under Blogger since 2013. I thought this would be a useful post for fellow bloggers who would search on how to upload the ads.txt to their Blogger platform domain.

So, here's how it is done.

Step 1 : 

Login to your Adsense Platform and click on "Download" to download the ads.txt file for your domain. You will see a one liner text in the file with the Publisher ID.

Step 2: 

Login to your Blogger Platform. Go to Settings >> Search Preferences

Step 3: 

You should see "Monetisation" at the bottom end of the Search Preferences. Now, here Custom ads.txt would be disabled. Click on "Edit"

Step 4 :

After you clicked on the Edit Link, you should copy paste the content from the ads.txt file and click on "Save Changes".

Step 5: 

Now is the time to verify if the changes are present. You should be able to verify this by going to your blog root domain in a new tab and enter /ads.txt.

This will show you the ads.txt content that you have updated in the Blogger.

As it is mentioned in the Adsense Alert Message, it might take a few days to see the updated changes in your Adsense Account. Be Patient and keep Blogging.

Let me know in the comments if this worked for you. Happy Blogging.

Read More

7 Jan 2018

// // Leave a Comment

7 Ways to Improve Your Twitter Connections

There has been a wrong idea circulating among people that "Twitter is not for Everyone" which is completely irrelevant to how Twitter is designed to work. I would say that Twitter is an amazing medium of cut short messages, instant news platform and if used properly, it could become a very well platform for marketing/ advertising your product or a brand per se. 

 Do you think that way too ? If yes, read through the below 7 points to see how you can leverage your twitter account to make good connections and advertising your brand.

Start Following Back :- 

Now who wouldn't like a million followers to their account . Wouldn't you ? This has to be the first and foremost work that needs to be set right to get your twitter account and your connections upto the mark, unless you are already a brand that has established its worth on twitter.

If someone's following you, that clearly means that they are showing their interest to see what you have in store and eventually expecting you to follow back too. Now you may tweet all the things that you are doing good and a lot of other things, but they'd like you to follow back as well. If you're not doing that, its most likely you will end up loosing that one follower from your account which is the same with all the followers over the course.

There are users who tend to "DM- Direct Message" you to follow them back and its normal and there are users who would expect you to do the favour of following them back without asking for it. It is for you to decide whether the follower you just gained is worth following back or not. There's another post that talks about interacting with your peer users on Twitter efficiently.

ShoutOut and Engage in Conversations :-

I think this is powerful if you'd want to stay on course with your followers to actually make them feel that you're worth having a conversation. #SO is one of the many twitter tags that users find commonly being used to make a shoutout to your peer follower/following users.

Use the hashtags wisely. Now you don't want to spam your follower with too many hashtags that makes the conversation irrelevant in most of the cases.

 Call out names and start engaging in conversations that will make them feel special and next time they will look forward to your tweets. Now this may not seem like a wise idea if you already have a million of followers to your account but still could be considered doing this once in a while to keep up the interaction factor going forward.

 Its time for you to decide what you should be doing now to make your twitter connections awesome and interactive.

Usage of GIFs :-

Let me tell you this, gif images works all the time. It's attractive and catches the eye on spot and people would want to retweet, start a conversation over your tweet.

 Just a random search for "gif" on twitter gives the below link where you can see for yourself the number of retweets and favorites and replies to the tweets with gif images. That proves it now, doesn't it ?

Ask for Opinions :-

Asking doesn't make you any less than the other person who doesn't, the fact that it only makes you a better person and makes you approachable. Ask for Opinions in the form of tweets. Fellow Twitter users would be happy to reply back to your tweets if that interests them.

Convey a message, or a help if needed, all you have to do is ask and that your twitter herd listens and you might not know, you will have your solution one tweet away.

 Coming to the point, asking for opinions, thoughts, helps improve your connection on twitter.

Use Polling Feature :- 

Polling Feature on Twitter is one of the ways to improve your twitter connections. There are a lot of scenarios where you wanted to choose an option from a group of options and you can actually ask it out on Twitter suggesting your connections to choose one for you.

 This will actually improve your perspective on seeing things in a different way and you can even start tweeting back to your twitter users with the feedback that will create a whole new conversation altogether.

Tweet Back :-

As far as Twitter connections is considered, its not one way. Meaning, you have to often tweet back to your other fellow followers, followings tweet and start engaging yourself in a conversation.

This will give you an option to be seen over a wide list of people, your followers/followings followers and improve your connections along the way.

Share Quotes :-

I have found this as one effective way to improve connections, infact it works all the time. Sharing Quotes as a tweet get more considered than a normal tweet like "What a crazy day! ".

The Retweets that you get and the views on your quotes will automatically improve your connections with quality followers overtime.

 Now that I've shared all the 7 ways that I myself use frequently, we have come to the end of this post.

 Let me know if I've missed out any of your favorite ways and also how is it working out for you in the comments.
Read More

27 Aug 2016

// // Leave a Comment

How To Get Verified On Twitter Through Application Process

Yay.,! Have you heard the news ? Now you can get verified on Twitter by applying manually telling them you're the one. Yes., I was wandering for news on Twitter and found this which I thought I should write about it on this blog. 

I've been writing about Twitter tips and stuffs related to Twitter for sometime as of now and like everyone else who's using it frequently not just to share their blog links but to read news as well, I've the fantasy of getting verified on Twitter someday too.

Getting a verified profile on Twitter is special for the ones who know its value., Okie., now let me share you how I've applied for the twitter verification process.

As I was browsing through Twitter I found this link in their blog - How to Get verified on twitter through Application Process which I was thrilled to see.

As you know being a twitter user., getting a verified profile is not a small thing to have in your profile. And the process that was happening before sounds very much manual to us where the twitter guys would selectively pick the profiles from millions of users and grant them the loyalty. I've wrote about it some years back How to get a verified Twitter Account when I was kind of a noob and was still trying to understand how twitter works.,

Now that I've seen the Application Process Verification, I started the process not even thinking about anything else.

Before applying to get verified, you should look into their tips page where they tell you what you should keep in mind before applying and what's needed. Find the link below.

Request to Verify an Account

After you finish reading it, you can follow the link - Verification Request to finally start applying for the verification.

If you don't get it the first time, you can still apply for the same account after 30 Days following the same verification link.

P.S : I've applied for the verification process as well. Feeling excited. I'll write a blog post with the update once I get a mail back from them either positive or negative.

Photo Credit : Flickr- Mambembe Arts & Crafts

Read More

19 Jun 2016

// // 5 comments so far

How To Optimize Images with WebP Format

Do you own a website ? If you have a website, or any business that is running online, or even a blog for that matter, you should make sure the site runs fast and the users can access it without any waste of time. 
Load time of a web page matters in the online business., Lets say you have a great website with colorful images, and really nice design and rich use of JS animations. It'd take hell amount of time to load the page and the user who's trying to visit your website, gets annoyed by the time that it takes to load and it'll lead you to a heavier bounce rate which will kill your blog/website rating at any time.

I was just surfing the web recently and I found something called "webp" format which is a modern image format with the tagline "lossless and lossy compression" for images on the web. I couldn't help but write about it in my blog here.

It's been said that WebP images are 26% smaller in size when compared to PNG images.

You can read more about how webp works here

WebP format is natively supported in Chrome, Opera browsers.,

In this post, we'll tell you how to use webp format to optimize the images for your website/blog in the following steps.

Step 1: 

I'm guessing you've followed the google webp link to know a bit about the format. Now, lets download the precompiled version of the tool that we'll use to convert any image to webp format with lossless and lossy compression.

Download the precompiled version of the tool here

Choose your platform - Windows, Linux or Mac OS and download the files.

Step 2 :

Extract the zip/tar file, copy and place it anywhere you feel convenient. In my case, I'd place it in my C drive.

So, now the path of the files in my system would be "C:\libwebp-0.5.0-windows-x86" 

Step 3 :

Once that is done, go inside that folder "libwebp-0.5.0-windows-x86" in your drive that you've copied it to.

Now, lets copy an image that you want to compress and check if its actually working. Copy a bit bigger sized image and place it inside "bin" folder which would be like below


Step 4 : 

This is a bit trickier part yet you can do it even if you're not any sort of developer, or just someone who knows to operate basics of command prompt.

Open your command prompt and navigate to the installed folder. Check out the screenshot that is attached below to make sure you're on the right track.

Once you're inside the bin folder in your command prompt, run the following line

"cwebp yourfilename.JPG -o webpfile.webp"

If you've done that correctly, you'd see the below screen.

Now if you check the size of the image that's been created, you'd be amazed of how much smaller the image size you get out of it without losing its pixel sizes and quality.

There's a reason why the webp format is being said to be "lossless and lossy" . You can even convert back from webp format to any other format such as PNG, JPG etc, with "dwebp" command. 

Checkout the parameters that you can use with "cwebp" command - cwebp command

Checkout the parameters that you can use with "dwebp" command - dwebp command

That's it. you can do the image compression with just one command without using any photoshop tool.

P.S - Do comment below to let us know how did it go or even if you get stuck somewhere.,

Photo Credit : Flickr
Read More

30 Mar 2016

// // 9 comments so far

5 Things to Know About Twitter Analytics

Are you running a business offline or online? It doesn't matter where you do and what you do, but it sure matters that you use any medium of influencing people to come to you, use your service in anyway possible. I've been writing my way through twitter ever since I've found its usability as a media to publicize yourself as a brand no matter what you do and where you're located in any part of the world.

Using twitter has made me realize there are people who take the slightest care of what you do and those are the like minded people that you'd want to follow and want to be followed back. Setting up a twitter account is not a heavy task and the part of being online (by online I mean the way you stay up tweeting frequently without giving up) is a hell of a job if you're running up a business motive on twitter. Unless you've a twitter account that tweets random thoughts that comes to your mind, tweets with media that you see day to day, you wouldn't be running out of tweets.

To use Twitter Analytics efficiently, you should know the least about it at some point of time.

Twitter has given us the option to check who actually are interacting with you and how are you doing last month compared to this month and how exactly are you growing on your followers rate/ following rate and everything that get accounted which is the Twitter Analytics Platform.

In this post, we're gonna list down the 5 thing that you should know about Twitter Analytics before you start using it.

Monthly Tweet Analysis : 

Tweet Analysis is what we're going to talk about. Brands or Businesses that are tweeting every now and then from their official account should be using this analytics to collect the data of how far their tweets have reached the world, how good is the engagement of tweets with the fellow twitterers.

Normally, you can see any particular tweet activity just by clicking on the "View Tweet Activity" in your tweet section. That will give you a clear analytics of how did that tweet go with the twitterverse.

You can now view weekly activity of your tweets on the right side of your twitter dashboard as well. But when you want to collect the data monthly so that you can account yourself with the growth that you've reached this month and can easily compare yourself to the previous month and do what you should do to be better next month.

That's a good one and they show you your top tweet for the month, top follower for the month, top mentions, top media tweet, top card tweet etc., all for the particular month that you prefer. Scroll down to your twitter analytics dashboard to see older months analytics data.

You're a social media marketer, that's great., you're just steps away to collect those data and make your excel sheet for the month.

Know Your Influencers : 

Twitter is letting you know who was engaging with you the last month most of the times and is showing you the details on what tweet the whole engagement was happening.

Get the data on what was your top tweet on twitter last month, who was your top mention, who was your top follower, what was your top media tweet, what was your top card tweet, all in one single page of Twitter Analytics.

Top Card Tweet for the Month

Top Follower for the Month

Top Mention for the Month

Top Tweet for the Month

You get to know who's your most interesting influencer on twitter in short, you get to know a like minded personality to your business.

Now that's a lot of valuable data for you and your company that runs its promotion on twitter.

Export the Twitter Data : 

The twitter analytics data that you see for a month or any relevant period of time can be exported to your local system in csv format.

You can select any particular number of days, years range which lies next to the export button on top of your tweet activity. Now that should be considered as a lot of data related to your twitter market.

Flavour of Audience:

Knowing your audience is the key to promote your business to the fastest level. Twitter Analytics provides you with the data of what audience base that you're followers are and where exactly you can improve to make sure a lot of people read your tweets and engage with it.

Audience Analytics will help you to improve the understanding of your followers base and tweet accordingly. The list shows the people who have engaged with the tweets that you've been tweeting since the given time period.

Conversion Tracking : 

Twitter provides you the conversion tracking facility just like Google Analytics where you're (the developer) supposed to put the code to your website and the tracking starts immediately once your code is verified.

The Conversion Tracking works in such a way based on the code that you're implementing to your website. You can track any particular page conversion event based on the conditions option when you're setting up the conversion tracking event.

You can add even multiple accounts to the same analytics dashboard. Click on the username on top right, and select the account that you want to use with the analytics dashboard.

Conclusion : 

The data that you get from twitter analytics can be a good option to analyze the growth of your business and make any changes needed to promote your brand on twitter.
Now, that's an important piece of data to your brand.

What features do you like about the Twitter Analytics Platform ?  What do you think it is less of ? Do Share in the comments.

Image Credit : Flickr
Read More

28 Feb 2016

// // 2 comments so far

How To Find The Number Of Verified Followers On Twitter

Having a verified profile on Twitter is not a small achievement to have on your portfolio unless you're a famous celebrity in your line of work. Getting verified on Twitter is as much as not in our hands until Twitter decides to contact out for Verification.

If you've come to read about how to get verified on Twitter, I'd suggest you to read the linked blog post below.

Read this : How To Get Verified On Twitter

Let that be aside. You have a number of followers that you could even possibly count each and every one of them in hands. Have you ever wondered how many of the verified profiles that follows you ?

Have you ever asked yourself to check that once after you lost count of your followers which I'd say when you reach 100 followers you'd loose the name count of the people who followed you.

When I started using Twitter, I used to follow people and let them follow me back and we exchange tweets, retweets, and favorite each others tweets which are the most used functionalities on Twitter

I happen to count all the followers that followed me and welcome them with a Shout Out (SO) either automated or manually (Atleast when I started out).

While I use Twitter I happen to be followed by some of the verified profiles on Twitter which is pretty awesome actually and you'll feel good about it for no reason. I lost count of the number of verified profiles that follow me on my account later on which led me to find some pretty cool tools that I'm going to share in this blog post.

That was the reason I had to research on any tools that will help you to find the number of verified followers on your Twitter. And I found one.

Social Rank

Social Rank is a platform where you can organize, sort out your twitter followers in case you have way too many to do it manually on twitter.

You can even sort the followers and create a curated list of followers and use it for any purposes that you are planning to may be promotional tweeting, call it your choice.

Once you're logged in to social rank, you'll see the list of followers that follow you on twitter. You'll see a select option where you can select "Verified Followers" and there you go, it'll show you the list of verified profiles that follows you on twitter.

Here's a screen shot of my list of verified list of followers on twitter from Social Rank. 

Me on twitter- @vickythegme

Feel free to mention any other tools that helps you find the list of verified profiles that follow you on twitter. And don't forget to let me know how many verified profiles are following you on twitter in the comments.

Photo Credit : Flickr

Read More