Maximizing productivity when working on multiple software development projects

Software development is a creative pursuit and to enable the creative mind some cues are required, to get in the zone and kickstart the process.

I am a web and mobile app developer who works on multiple projects during the day, and to enable myself doing so I have created different zones for each project, where I can get in the zone and work on my craft, working on multiple projects requires some amount context, and switching context is taxing on the brain.

So in order to work on multiple projects during that day, I work on one project at a time, with a dedicated time slot for each project and a different workspace for each project.

A different workspace means a different desk, chair and a computer for each of my projects and ideally at a different location. Currently, I am working on 3 projects, so I have 3 computers and 3 desks, each dedicated to a separate project.

Now some of you might think it is wasteful, but trust me it is not. Dedicating a workspace for a project is one of the best money I have ever spent because after I am done working on one project, I do not have to close the editor, the tabs etc. I can just leave the things where they are and come in the next day and continue from where I left.

If you look at the desk of creative geniuses like for e.g Einstein or Steve Jobs they have messy desks, and the programs open in your computer is akin to things on your desk that you require when working on your project easily accessible so that you don’t have to break the flow of the what your working on and quickly access the programs and files and keep going and working productively and seamlessly resume where you left of.

By closing all the windows on the computer to switch to a different project and then coming back to the first project you have to re-think and re-load all the variables again in your brain, whereas if they are already open you still have to do some mental loading of the task but it is far less as compared to the re-opening all the stuff e.g the editor and browser tabs.

Steve Jobs Desk at his home office
Einstein’s Last Desk

With computers being more and more affordable it is an incredible luxury afforded to us by the modern times that I can dedicate an entire computer for one project and it has been a great boon for my productivity as I do not have to load things into my brain, when I sit on the desk for a project I just get going.

So if you are a programmer that works on a single project at a time then great for you! But if your profession demands you to work on multiple projects then trust me dedicating a separate workspace for each of the projects would be a great investment.


So in summary based on my experience the best way to work on multiple projects is to have a dedicated workspace for each project so that you can get in the zone with minimal effort.

If you have something more please share your thoughts in the comments.

Online Payments: Ultimate guide for startups

Starting a new company, need to receive payments online.

No worries,

In this article we are going to explore:

  1. Various online payment Gateways and
  2. their pros and cons, lastly
  3. Which one is should you go for, with regards to where you are:
  1. Canada
  2. USA

If you Live in Canada here are your options:

  1. Square (
  2. Flywire (
  3. Moneris (
  4. PayPal
  5. Stripe
  6. 2Checkout
  7. Shopify payments
  8. Amazon Payments (US only)
  9. TD Bank portal


Stripe is a payment processor made for startups and developers. They have  an excellent api and documentation. You can take one time payments organise subscriptions and have extensive reporting regarding payments.

Many Silicon valley startups such as lyft, instacart, taskrabbit etc use stripe for online payments.

Stripe also has many integrations such as:

  1. Docker
  2. Docusign
  3. Marin
  4. Tableau
  5. Hubspot
  6. splunk
  7. optimizely


Regarding fees stripe offers 2 plans:

  1. Pay as you go
  2. Enterprise

In pay-as-you-go Stripe charges 2.9% + c$0.30 per transaction. Payments arrive on a 7-day rolling basis. Plus if the customer is using an international card an additional fees of + 0.6% apply and if you provide international customers ability to pay in their home currency an additional fees of +2.0 % will apply. Volume discounts are also available if you earn more than c$50000 per month.

Stripe also comes with mobile sdk and Apple Pay:

Here are the full features of stripe:

Stripe features are categorised as

  1. Aceepting payments
  2. Process
  3. settle and reconcile
  4. manage

Accepting payments:

Pre-built UI components: Use Stripe’s pre-built UI components to design your own custom payment form.

Embeddable Checkout: Get a prebuilt embeddable checkout form to add to your website. With just a few lines of code you get pre-built checkout ready to serve customers.

Checkout Api’s: Create your own unique checkout experiences with Stripe.js Api’s.

Invoicing: You can also use Stripe to invoice US based customers, customise the invoices to match your custom branding, payment terms and accept cards as well as ACH payments.

Open source plugins: With a variety of plugins available for Stripe you are spoilt for choice. Here are some: 1. WordPress 2. Magento 3. WooCommerce etc

Payment Options

Cards: Cards from all over the world work with stripe including: VISA, MasterCard and American Express

Wallets: Stripe works with almost all the major Pay wallets. Here is the list:

  1. Apple Pay
  2. Ali Pay
  3. Google Pay
  4. WeChat Pay
  5. Visa Checkout
  6. Microsoft Pay
  7. MasterPass by Mastercard

Local Currencies : Process and display charges in customers local currency. Stripe supports currencies of 135 countries


Accept payments from iOS Android or mobile website, with Stripe mobile Api’s you require no backend changes and only a few lines of code:

Process Payments:

Stripe has a pre processing layer that lets business get closer to multi-regional direct connections to major card networks including Visa, Mastercard and American Express.

Here are the sub features for the Payment optimisations:

Retry Logic: automatically retries technical refusals through alternate means

Smart MCCL Automatically assigns Merchant Category Code according to your type of business for maximum auth rates

Updates Card Accounts: Automatically updates expired cards or renewed cards to reduce failure rates. Stripe does this by working with card networks to update customer card data.

Payments and Disputes: 

Stripe fraud prevention tools are best in business including a machine learning fraud prevention system, transpareant risk scores custom rules engine, real time fraud insights.

According to stripe statistics there is a 89% chance that a card has been used in the stripe ecosystem.

Stripe has to an extent also eliminated a lot of manual work related to handling disputes with their end-to-end automated process that works with card networks such as visa. They submit evidence that’s most likely to see the company win over the consumer.

Settle and reconcile:

Through Stripe API and Dashboard you get real time data

Through Stripe API and Dashboard you get real time data about charges, refunds and transfers.

Financial reporting: stripe gives advanced financial reporting capabilities, reconcile cash transactions with those recieved form cards and merchant gateways – every deposit in stripe is tagged with a transfer report containing  details of the transactions like at what time the transaction happened what were the fees involved etc.

You can also create monthly reports and transacton level balence breakdown stripe also has custom reporting via the API

Accounting support: You can automatically sync Stipe data with your accounting software ledger. or export stripe data into csv 


Stripe gives you a dashboard so that you can see the timing of the payout and the expected date you are going to receive them, you can also get unified payouts in your own curriencies from different cross border transactions. Or in select regions opt to receive money in different currencies.

Manage Payments

Get reports about consumer data with custom sql query support pre built queries and core metrics. Get mobile apps for consumer analytics as well.

Business operations

Give roles and permissions to employees keep sensitive data protected while allowing tailor made access to speacific employees.

High security 2 step authentication for login gives you peace of mind 

Also you can attach notes to payments for your team members to review.

Third party integrations:

Stripe offers a whole lot of third party integrations from accounting, analytics to email chat apps like Shopify slack iftt etc

Get 24 X 7 support via EMail phone and Chat


Paypal is another very popular alternative to receive payments online. You can receive payments via PayPal credit card and debit cards

Paypal offers fully customizable cart integration with receive, customers can pay without leaving your site you can even accept payments over the phone fax and email.

with paypal you can accept 25 currencies from 202 countries. PayPal offers two plans one normal PayPal with 2.9% + $0.30 fees and a pro plans that has access to api’s and other goodies with $35 per month and 2.9% + $0.30 per transaction.

PayPal offers Detailed order management you get logs, monthly statements and transaction history 

One unique feature that PayPal offers is the virtual terminal with it you can process phone orders, fax orders and mail orders around the globe.


2Checkout is another checkout that is widely used with support of 87 currencies and 15 languages you can accept debit cards credit API’s and even paypal.

2 checkout also offers api and integration with over 100 + shopping carts, you can also opt for hosted inline checkout experience with customers having the feeling that they are still on your site while making a payment. 

Or for complete custom experience use the API’s to built a interface for yourself.

With 2 Checkout you can have recurring billing advanced fraud protection and advanced analytics they even have a monetization platform called avangate.

2 Checkout charges 3.4% + c$0.45 per transaction plus an additional fee of 1.5% if the customer is from outside of Canada. 2 Checkout also charges an of 2-5% above daily bank exchange rates for customers outside of Canada.

If there is a chargeback 2Checkout also charges a fee of $25. In my opinion, 2 Checkout is one of the pricier options.


Moneris is Canada’s leading payment providers. Moneris offers both Hosted Pay Page as well as customizable API.

Moneris offers a variable fees across cards plus a flat fees +0.08% 

Moneris also offers 24/7 on call customer service. Although Moneris offers online payment options it is more of a onsite product, packed with many features to receive payments from cusotmers on site. 

Shopify payments

Shopify Payments

Shopify payments is the easiest way to pay if you are using Shopify already. Needless to say, it is seamlessly integrated into Shopify. Depending upon what Shopify account you have rates vary. For the basic account, you have 2.9% + c$0.30 for domestic cards for international cards you have 3.5% plus c$0.30 per transaction and it reduces as you go up.

you can see dashboard and payment analytics on the Shopify dashboard. Well, that’s basically it. If you are using Shopify you can opt for Shopify payments

TD bank portal 

TD bank is recognized all over Canada as a trusted bank and they also offer trusted merchant banking solutions with all the services that you need.

Virtual solution, Hosted solution and customised solution

TD also has all the standered features like online reporting etc


Square is a nice alternative to receive money online. It charges a fee of 2.9% + c$0.30 per transactions. One good thing about square is that you can get your money as soon as next working day. They also offer square dashboard and an iOS app to access real-time data and powerful analytics tools.

Square also has phone support if you run into any problems.

Square has APIs as well you can either integrate a pre-built square form or integrate it with your preexisting website with the help of apis

square also integrates with a lot of third party systems like CRM ERP and many other business and accounting solutions

Square also offers point of sale solutions such as accepting cards with mobile phoens and square swipe devices to accept credit and debit cards.


Flywire is another contender in the race to help businesses accept money. With customers such as Expedia, Hilton and Volvo, flywire also has a host of services on offer


  1. easily process international payments
  2. bill international customers in their own currencies with competitive exchange rates 
  3. Get automatic reconciliation of your invoices with many of the third party accounting systems
  4. Get a dashboard to monitor fund transfers online.
  5. Get 24/7 customer support available in multiple languages.

Hi, I am Mohammed full stack javascript developer with expertise in NodeJs angular react and Vue JS. Contact me for freelance work at [email protected]

Delaware LLC vs C – Corp

The Definitive Guide for Startups

So you are working on your new startup and you have your business plan , the money you are going to invest in your business and even figured out operations and marketing.

But some question remain.

What sort of business entity to form (LLC / C-corp/ S-corp) and where?

Many startups and VC funds favor Delaware to form a company.

In this article I will let you know:

  • What are the benefits of forming a company in Delaware?
  • What are the disadvantages of forming a company in Delaware?
  • Should you form an LLC or a C Corp or an S Corp? 
  • How can you form a company? What are the costs involved

Note: This is not a legal advice and I am not a lawyer, please consult your lawyer before taking any decisions.

Benefits of forming a company in Delaware

Delaware has a reputation for being liked by startups and Venture Capital funds for the following reasons:

  1. Corporate Law
  2. Privacy
  3. Startup costs
  4. Tax purposes
  5. Few formalities
  6. Easier to raise investments
  7. Structure

Corporate Law

Delaware has a special court of Chancery for law disputes and strong protections for companies that are incorporated in Delaware.

The outcome of cases in Delaware is more predictable because of the following reasons:

  1. A large volume of cases are recorded in Delaware hence there is a large base of precedents that can be looked into and hence there is less uncertainty if there is a case filed against your firm.
  2. Delaware special court of chancery has judges with corporate law backgrounds, hence cases are decided quickly and with justly as compared with courts where judgment is in the hands of ill experienced juries.
  3. As more than 60% of fortune 500 companies and a large number of private and public enterprises are incorporated in Delaware, more corporate attorneys are familiar with the Delaware laws and it’s more convenient to hire a lawyer.


You don’t have to name your shareholder’s officers and directors publicly. Only in the case of law enforcement you need to release these names. Hence it provides a layer of privacy.

Startup costs

There are minimal startup costs in Delaware. In Delaware, you can easily maintain an LLC with $300 in yearly costs and a C corp with $800 in approx yearly costs.

If you are forming a C corp. even a single person can perform multiple roles of the shareholder, officer, and director. In other states, you need at least 3 people.

Tax Purposes

Following are the tax benefits of incorporating the company in Delaware:

  1. There are no corporate taxes in Delaware if you do business in another state.
  2. There are no royalty payments or taxes on intangible assets such as patents.
  3. There are no taxes for non-resident individuals or entities (that is if you don’t reside in the forming a don’t do the business in Delaware you don’t need to pay income taxes, sales tax or any other kind of tax)


Many investors and Venture capitalists prefer Delaware because of they are familiar with the business laws hence it is easier to get an investment in your firm if you are registered in Delaware as compared to other places.

Disadvantages of forming a company in Delaware:

Drawbacks start when you are incorporating in Delaware and aren’t actually doing any business in Delaware. If you do that you will need to re-register the company as a foreign entity in the state in which you are actually doing the business.

Hence now you will have to do 2 filing instead of one and you also need to hire an agent and pay annual fees to them to pass on the legal notices and formalities for you.

Difference between an LLC s and a C – Corp

In Delaware and in fact anywhere in the United States, the most used types of corporations are LLCs and C-Corps.

What is an LLC?

An LLC is a type of company which is organized in an operating agreement.

An LLC is organized as a contract between members(owners) stating how it will be run and how the income and liability will be split between the memebers.

A few common characteristics of LLC:

They are designed to provide a corporate veil and a limited liability to the founders. That is moving liabilities, debts and obligations from the owners to the company to the company itself

LLC provides pass-through taxation that is generally the owners pay personal income taxes on the income earned by the business.

Formalities that are required by corporations such as board meetings, corporate resolutions directors issuing stock and drafting bylaws are eliminated. The LLC is governed by the contract between its partners, the contract itself is not required to be disclosed to the public hence it is easy to maintain and operate.

LLC can also be easily converted into a c corp. Converting a Delaware LLC to a Delaware corporation is straightforward and common enough that only a few forms are required to be filled to complete the process.

How to form a Delaware LLC: 

Forming a Delaware llc is quite easy you just require 2 things:

  1. Filing a certificate of formation
  2. Documenting your operating agreement

Before filling for the certificate of formation you must decide on a name for your firm and check for conflict with the Delaware Secretary of State. It can easily be done online.

Delaware does not require you to publicly release your name while filing for the certificate of formation, but you can include it if you wish to.

A certificate of formation must include:

  1. The name of the LLC
  2. The name and address of the registered agent
  3. The signature if the authorized individual

Delaware registered agent requirement:

You can form a Delaware LLC without visiting opening an office or maintaining a bank account in Delaware. However, the Delaware state act requires you to have an agent if you do not have an office in Delaware. You can hire one of the many agents available online just search for a Delaware registered agent, they charge anywhere between $120 to $300 per year and forward any document and legal stuff that the state sends you

Delaware C corp:

A corp is a full-blown corporation, they have shares and can also be listed publically and traded in the stock exchange

C corps are designed to be an abstraction between the operators of a business and owners of a business which may  or may not be operationally involved

Owners are called as shareholders and ownership is tracked by shares i.e more percentage of shares a person has. a more economic entitlement as well as the operational control they have over the company.

Characteristics of C-corp

Corporations are intended to provide limited liability to the shareholders. Shareholders are not liable for the debts and the of the company. If they have invested money in the company they can only lose the amount they have invested and nothing other than that

As a corporation, it is taxed separately from its owners i.e the shareholders. The corporations have extensive filing obligations, plus the shareholders are taxed again on their income.

Feasibility and suitability

LLC is the best choice if you wish to have a side project or have a bootstrapped company

LLCs are well suited for these companies because Intellectual property can easily go from members (owners) to LLC and vice versa plus there is minimal paperwork and hassle.

On the other hand C corporation requires a lot of ceremony for example s shareholder resolutions and meeting before Intellectual property can be transferred plus it is a big hassle, and time, as well as money, is required to run a C corp as compared to an LLC

International Owners

While the United States or Delaware does not impose any restrictions on citizenship or permanent residents for owning an LLC or a corporation. Owning a LLC for non residents noncitizen of the United States might

complicate the matters Non-resident owners of the  LLC in the United States are obligated to file income tax returns for income their LLC’s earn

For example, if a non-resident is an owner of an of an LLC in the United States. They will have to pay taxes in the United States for the income earned by the LLC and might have to pay taxes in the home country as well ( depending on the laws of the home country) thus resulting in double taxation.


Many venture capital firms and investor prefer c corps because the flexibility accorded with LLC require’s them to do extensive legal due diligence before investing and many do not prefer expensive legal work as a requirement to of in a company.

C corp is a corporation with standard laws and terms. So many investors prefer and require companies to be converted into C-corps before investing.

this article is written by Mohammed Lakkadshaw who is a javascript and Node JS developer. I am available for freelance work. I am neither attorney nor accountants, and this information should not the be considered either legal or accounting advice.

Tax loopholes while forming a Corp as a startup 

Thers is a lot of flxibility for planning your taxes in the c copr. A LLC will have to wait a few years to take advantage of tax benefits but an C copr can enjoy its benefits in the first year itselfd

These benefits are called as fringe benefits. What fringe benefits mensa that a company can give its employees benefits and deduct them as expenses for tax purposes.

The only condition is that the benefits must be for an array of employees not just the owners but if the only employees are owners, the owners can take benefit of this. these benefits can pay for health insurance or disability insurance of employees

In additionof owners pay themselves salaries, these salaries can be deducted from the c corps profits as running expenses plus c corp can retain earnings for future expansion as long as it complies with the appropriate tac provision s

C corp can deduct all business expenses such as cost of goods sold fringe benefits, salaries etc after all these, there is little income left to be taxed

C-corp also face lower taxes  on retained earnings  this is unique to C corps of the owners can use the tax savings to further expand their company

How to troubleshoot common HTTP error codes

HTTP error codes are crucial to the understanding client and server-side issues, This is a comprehensive guide for HTTP error codes and their underlying reasons:

And the Best Part:

 You will learn everything from a system administrator’s perspective, so you will be well equipped to solve those issues in a jiffy.

  1. Most common HTTP error codes?
  2. What do they mean?
  3. What are the common solution or fixes that you can try?
  4. A comprehensive list of all HTTP errors and other resources if you wish to explore more.

HTTP error codes indicate whether an HTTP request was successfully completed or not.

The HTTP responses are grouped into these five categories:

  1. Informational codes: 1xx,
  2. Success codes: 2xx,
  3. Redirects: 3xx,
  4. Client errors: 4xx,
  5. Server errors: 5xx

We will be focusing on the most common client and server side error codes namely 4xx and 5xx codes and common solutions to these codes.

Client error overview: Client-side errors are caused due to the client. This means that there is something wrong with the request that the client is sending to the server.

General errors include typo’s and maybe the headers are wrong or some such thing.

Server error overview: Server errors that code from 500 to 599 are sent when there is an error with the server or when the server recognizes that it is unable to handle the request.

General fixes and other tips to troubleshoot:

  • This goes without saying but this mistake is what many people do when doing server debugging.
  • Refresh the browser or the server debugging software after making changes to the server.
  • Check server logs

HTTP server codes are determined by standards that are implemented by the software running on the server. This means that the actual code returned by the server depends on how the server software handles the code.

This guide should generally point you in the right direction. Now that you have a general understanding this will help you in understanding the HTTP error codes:

Common Client Side HTTP error codes:

400 (Bad request error)

This code means that the server could not understand the request because the syntax is invalid. That is the request which was sent to the server had invalid syntax.


  • Check the syntax errors that might have occurred in your request. 
  • Try clearing the browser’s cookies and cache.
  • Try updating or changing the browser. That is browser might be really old/outdated and or faulty.

401 Unauthorized error:

Unauthorized error means unauthenticated error. It means the server requires authentication most commonly a password to access the file requested. It also means that the server is unable to recognize you as a user with proper authentication.

In this case, either the username and/or password is not provided or improperly provided to the server. 


Provide the proper authentication, in a proper way that is required by the server to access the restricted content.

403 Forbidden:

In this case the client does not have access to the content. it means that server recognises who the client is and the user has made a proper request to the server but the server is refusing to give a proper response to access to the requested files. Unlike the 401 here the client’s identity is known to the server.


403 errors commonly occur when users does not have the permissions to access the requested resource.

404 Not Found:

The HTTP error code: 404 not found means that the user is able to communicate with the server and the server is also willing to send the resource back to the user, but it is unable to find the resource the user is requesting.

If you are using a browser it might also mean that the URL is not recognised by the server. Or as I ssaid above it might also mean that the URL is valid but the resource no longer exists on the server.

This is one of the most recognisable error code on the web because of it’s frequent occurrence. 


If you are receiving a 404 error unexpectedly, here are a few questions to ask while troubleshooting.

  • Did you make a type error.
  • Does the file exist on the server or has it moved or been deleted ?
  • Is the file you are requesting in the directory that you are looking into.

408 Request Timeout:

This response is sent when the server closes the connection because the client is taking a long time to send the request. This happens when the client has a slow internet connection or if there is a huge load on the server.

Be aware that this error response is also often sent by servers even without any previous request by the client. It means that the server wishes to shut down this unused connection.

Nowadays, any modern browsers such as chrome and firefox use pre-connection to speed up the web and if it’s unused for a long time the server disconnects. please note that often servers disconnect’s even without sending the message.

429 Too Many Requests

The user sent too many requests in a given amount of time. This is generally done as a rate limiting measure. Often time providers of free API’s (for example: free weather api etc.) limit the rate at which the free user can access the data.


Wait for some time and try again or read the terms associated with API access point.

Detailed comprehensive list of HTTP error codes:

For a detailed list of HTTP error codes and their meaning please refer to this resource by Mozilla: HTTP response status codes

Common server-side HTTP error codes:

500 Internal server error:

The server has encountered an error and it does not know how to handle it. Sometimes the code will appear with more specific errors of the 5xx type.

The most common cause for this type of error is server misconfiguration.

502 Bad Gateway:

This means that the server while working to get a response from another server that is needed to handle the request got an invalid response. 

That is the server which the client sent a request to is a proxy server and needs to get the data from another server.

That is the server which the client sent a request to is a proxy server and needs to get the data from the parent server. The proxy server is not able to get a valid response from the parent server.

The most common cause for this is server misconfiguration. Having missing packages or not properly load balancing the server might result in these errors.

503 Service Unavailable:

Means that server is unable to handle the request possible cause may be that the server is under maintenance or down for some other reason or that the server is over loaded and cannot handle the request.

If the server is not down then it means that either the server resources such as CPU ram or bandwidth are unable to handle the traffic. Either server needs to be reconfigured to allow more traffic by increasing the resources or some other optimization must be done.

Note: If you are sending this response during heavy load times or for some other reason a user friendly html page or message should also be send explaining the problem and an estimated time frame for the resolution of the problem. For this you can also user the Retry-After: HTTP header.

You should also take care not to send caching-related headers during these temporary conditions.

504 Gateway Timeout

This error is recieved when the server is acting as a gateway or a proxy server and is unable to get a response from the proxy servers in the stipulated time period.

Main causes and solution for this:

  • There is heavy load on the parent server.
  • There is a lot of latency between the servers because of location or slow bandwidth


You are now familiar with Common HTTP error codes and their common solutions. Hope this article helps

About Me:

Hi, I am Mohammed Lakkadshaw for more information about me please visit my blog and website:

5 Most useful ES6+ Features

In this post, I am going to share with you Javascript ES6+ features that I find the most useful:

  1. For…of Loop
  2. Arrow Functions
  3. Async and Await
  4. Template literals
  5. Destructing

For…of Loop

Before either we had to write a full for loop or call the forEach function on the array to iterate over its item.

Previously we had to do this

Now with the new version of JavaScript, we can simply write the For…Of loop

If we have to iterate over an object’s keys we can use the For…In loop

Arrow Functions

If you have done programming in JavaScript you must be familiar that we have to create a LOT of functions in javascript as it is an asynchronous programming language.

With the new Arrow Functions, it makes the code cleaner and also saves you a few keystrokes.

Consider the following example, previously we had to do this

Now with the ES6+ syntax, it can be compressed into a single line, in a single like arrow function we don’t have to write the return statement, the value of whatever expression preceding the arrow will be returned.

We can also create multi-line arrow functions that accept multiple arguments

Async and Await

This is the feature that I use a lot especially when doing server-side programming using Node.JS, but you can also use it on the front-end and it also works in all the major browsers.

With Async and Await keywords, you can write asynchronous code that uses promises appear as if it is synchronous and make the code more readable.

Consider the following example without async await

Now with Async and Await keywords, we can update the code and make the asynchronous functions look like synchronous functions and it results in a much cleaner code, see for yourself:

As you can see with the update the code is much more simplified. To use async-await first you have to create a function with keyword async, then inside the function, you can call asynchronous methods that uses promise and add the await keyword in front of the function call.

Template literals

Template literals is a very useful feature, previously we had to use string concatenation the can quickly get out of hand if we are using multiple values or if want to construct a multi-line string, consider the following example

The code can be simplified with template literals

To use the template literal we have to enclose the string in ` and then enclose the variable name under ${<variable_name>}

Template literals can also expand to multiple lines

Imagine constructing the above code using string concatenation, it would be an unreadable mess.


Destructuring allows us to extract values from an object and easily assign it to variables.

Considering the following example, here is what we normally do when we want to extract values from an object

With destructuring you can simplify the code as following:

and we can use the name, age, and occupation as variables in our code.

That’s it!

These the feature that I find the most useful in ES6+, please share if you found it interesting and let me know in the comments what ES6+ feature you like the best.


Embedding Rocket Chat using iFrame Auth

Recently I was working on a project where I had to embed on a website, and when the user login to the website, they will also get automatically logged-into

The following steps have to be performed:

  1. Check if the user exists in
  2. If the user exists then login user
  3. If the user doesn’t exist then create the user in Rocket. chat and log in the user

I went through the Rocket chat documentation and figured out the best way to do it would be through a combination of iFrame Auth and the Rocket chat REST API. The iFrame Auth will be used to perform login and Rocket chat REST API to create a new user and generate tokens, but the documentation regarding the iFrame Auth was not quite clear and it was confusing, I also studied the provided example code and then after some fiddling I was able to implement my solution and I will walk you through the steps:

Login, Create Account and Server Setup

When doing iFrame Auth, Rocket chat sends few requests to our server so we will have to create few API’s on our server that Rocket chat server would call to authenticate the user.  I am using Node.JS + Express on the server side in the following example but the logic is similar even if you are using a different server or programming language.

Creating a wrapper to encapsulate Rocket chat API

We will call the Rocket Chat API to create a user in Rocket chat and we will also use it to Login the user and get the token.

First, we will have to obtain Rocket Chat Admin UserID and Admin Auth Token, this can be done by simply calling the Rocket Chat Login API:


Here http://localhost:3000 is the Rocket Chat URL and in place of myusername enter your Rocket chat admin username and under mypassword enter your password.

You’ll get a response something like this


Extract authToken and userId from the above response as we would need it in the next step.

Now we have to authToken and userId of the Rocket chat admin, we can use this to call Rocket Chat API and create new users in Rocket Chat.

The above code snippet we have created a few methods that are very self-descriptive. We will use these methods to create and login user into the Rocket Chat when user login to our server.

Creating API’s

In the above code snippet, we are creating routes that Rocket Chat will call to fetch the login token and authenticate the user, in the next step we will update the Rocket Chat Setting and include these routes.

Setting up Rocket Chat

There are few configurations that we have to make in Rocket chat to get it working with iFrame Auth.

Step 1:

Go under Accounts->iFrame and update the settings as per the screen-shot below Here we are specifying the routes that we had created in the previous step. http://localhost:8080 is where our local Node.JS server is running.

Step 2:

Go under General->iFrame Integration and update the settings as per the screenshot 

Embedding Rocket Chat

Now, after the setting on Rocket chat is done, we will embed Rocket chat into our web page, now embedding Rocket Chat is as simple as adding the iFrame on the page you want to embed

See the example below

Here http://localhost:3000 is the address of the Rocket Chat server and adding ?layout=embedded shows are cleaner UI.


That’s’ it! Let me know if you have any questions or suggestions in the comments below.

How to setup multi-domain SSL in Node.JS using letsencrypt-express/greenlock-express

Updated (14/June/2019)

Updated (22/June/2018): Support for Let’s Encrypt v2

I have updated the code snippet below to include the support for Let’s Encrypt v2 in the snippet below:

I wanted to set-up a multi-domain SSL certificate using LetsEncrypt for my app “Dead Simple Screen Sharing” because people complained about the long meeting URL, so I bought a short domain and edited the code to generate short 6 digit meeting ids, so the new meeting URL became much cleaner e.g instead of the original

But I needed a new SSL certificate for the domain, and as this domain will also be pointed to the same server, I required a multi-domain SSL certificate.

I had already configured greenlock-express (letsencrypt-express is now called as greenlock-express) on my server so just had to make some changes in the configuration and add my domain, but simply adding the domain in the domains array didn’t work, so after some trial and error I finally figured it out.

Here is the final code snippet, that you can use, add this in your app.js or server.js:

In line 10 replace ‘’ and ‘’ with your own domains, if you have more than 2 domains you can add them in the array, if you have only one domain then you also keep just one single domain in the array.

In line 12 replace ‘[email protected]’ with your email address.

The code on line 19 to 23 is optional, you can add it if you want to redirect all your traffic to https, and if you skip it then both HTTP and HTTPS versions of your site will be live.

Let me know if you have any questions, concerns or suggestions in the comments.

How to Setup WordPress blog with static homepage (Updated for 2017)

In the blog post, I will guide you through the process of setting up a static homepage for your WordPress blog when using the default TwentySeventeen theme.

The process of setting up a static homepage for your blog is straightforward. follow the steps below to make it happen:

Step 1: Upload your static homepage

The first step will be to upload your static homepage into your site, to do this you’ll have to FTP or SFTP into your blog, you can find the information on how FTP into your blog from your hosting provider and you can use a program like FileZilla or Cyberduck to FTP into your blog.

After you connect to your blog via FTP/SFTP go to the themes folder of your WordPress installation, usually it is located at htdocs/wp-content/themes/<theme_name> as we are editing the default “twentyseventeen” theme in our case the theme_name will be twentyseventeen htdocs/wp-content/themes/twentyseventeen 

Then in this folder, there will be a file named front-page.php, rename that file to front-page-old.php, if we don’t rename this file then WordPress will server this page as the homepage,  so we have to change the name of the file from front-page.php to something else.

After you have renamed the file, create new file name page_home.php in that folder, and paste the following contents into that file:

After the ?> tag paste the html content of your homepage in this file and save the file.

Now go to the htdocs folder and upload all the other static HTML pages you want to upload and CSS files associated with your homepage.

Step 2: Updating Settings in WordPress

Login to your WordPress Admin panel, Go to Pages->Add New, and create a new page with title Homepage and from the Page Attributes section select the Template as “Static Front Page” as shown in the  image below, and save the page.

Then we will also need a page to show our blog posts, Go to Pages-Add New and create another page, with title Blog, and edit the permalink of the page to /blog.

Then go Settings->Reading and in the section where it says “Front page displays” select “A static page” and from the drop-down select “Homepage” as the front page and “Blog” as the Post page.


Step 3: That’s it!

Following the above simple steps, you can setup the static homepage, let me know if you have any questions in the comments.


DeadSimpleScreenSharing 2: Open source browser based self-hosted screen sharing

This blog post is about a project that I have built, which is called DeadSimpleScreenSharing 2, which the next version of DeadSimpleScreenSharing, and it is much better and faster than the previous version.

It offers audio conference out of the box and supports sharing your screen with any number of users just by sharing a URL, and it is very high quality and super fast.

I am also offering a self-hosted version of the application that you can run on your own server, and the self-hosted version is also white label so you can rebrand it with your organisation’s brand name.

So, here is how you can use this super simple service:

Step 1: Go to and click the “Host a Meeting” button

Step 2: It will take you the chrome extension page, where you’ll have to install the extension

Step 3: After installing the extension, click the extension icon, and a window will appear, in that window click the “Host a Meeting” button

Step 4: Done! Your screen is being shared, you can share the URL with others so that they can join your session.

Using Postgres with Parse Backend

Facebook killed parse last year, but thankfully they Open-Source the parse backend. Initially, the Parse Backend only supported MongoDB database, but later support for  Postgres has been added by the contributor from the community.

So using Postgres with Parse Backend is really quite simple, you just have to install the latest version of Parse Backend, and in the databaseURI specify the Postgres connection string.

Here is an example:


As you can see in the example above we have specified the connection string to connect to the Postgres database.

If you are not familiar with the structure of the connection string, then here is the breakdown.

If you have any question, please leave the comment below.