7 steps to conduct a technical coding interview?

It’s always difficult conducting a programming interview. in this guide, I have provided seven steps to easily frame, conduct and evaluate a technical coding test.

While conducting an interview the final goal is really important, what do you want to find out about the applicant. Some of the common goals are:

  1. Will the candidate be able to write the code in a production environment?
  2. Can the candidate easily discuss problems and code with other people and are they are to read other peoples code easily and understand it?
  3. Does the candidate have a knowledge of algorithms and can solve programming problems given arbitrary constraints?

Apart from strategic goals like programming languages and knowledge of specific frameworks there are some tactical goals as well that you might want to achieve:

When you have given a specific coding problem or task for the candidate to solve, the process by which he/she solves it is more important than the result itself. Here are some pointers to help you along the way.

  1. As such everyone makes mistakes but what kind of mistakes were made. Were they mistakes due to a lack of knowledge about a subject or were they mistake due to unfamiliarity with the problem or were these mistakes due to sloppy work performed by the candidate. How fast were they able to recognize and recover from the mistake
  2. When the candidate solves the problem was it because of skill or were they just plain lucky? Did they have a good logic for solving the problem the way they did? 
  3. Can they candidate discuss and explain to you how they solved the problem and what was the logic behind how they did it? Were you able to understand what they said?
  4. Does the candidate have a good grasp of their own code? Can they easily make changes in the code in a short period of time? Or are they taking a long time to understand their own code?

Tactical Goals:

  1. On the Job performance
  2. Setting them up for Success
  3. Minimize distractions while they are working

On the Job performance:

We want to see how the candidate performs on the job he/she will be tasked to do. So, create an environment as similar as possible to the one they will be working in.

The problems given to solve as well the work environment should be the one they will be facing on the job in their day to day activities.

Things like refactoring the code on a whiteboard or remembering the Api documentation are quite challenging but is not of much significance in the real world.

Refactoring the code they have already  written to work in a new direction. Debugging the code that is not showing any problems in the console is a core skill any programmer would need but many coding tests fail to test for.

Not everything challenging is very useful in day to day life of programmers and use should make a conscious effort to focus on stuff that they might require in the job.

Setting them Up for Success:

You want the programming task to be a challenge but everything else should be such that it helps the candidate to succeed.

You should have a mind set that you want the candidate to succeed.

The instructions should be clear:

There should not be unclear instructions and expectations of outcome, the candidate should not be in a guessing environment of ” what the interviewer really wants to see in the test”. The candidate should not have to deal with aggressive or hostile persons.

You want the candidate to succeed and give their 100%. If you decide not to hire someone it should be because despite their best efforts they were not able to perform on the test. Not because they couldn’t perform because the testing place was dimly lit, or instructions on the task were unclear. Good programmers are difficult to find and if you miss out on them because of silly stuff, its really your loss.

Minimising distraction while they are working

Because coding is both an art and a science you want to minimise distractions as much as possible. More time you can observe them doing work, debugging and have a discussion over their approch to solution the better you will be a judge of their capability and skills.

Make sure they understand the problem and correct them if they veer off the solution. But unnesssory discussions and intrupption distract the developer and does more harm than good.

Contraints and limiting factors of conducting coding interviews

Contraints:

Being Lucky:

Let us assume, a candidate is given a programming question to solve, and they finish it easily and correctly. How they got the solution could be in one of these ways:

  1. Candidate is highly knowledgeable and a skilled performer, and using their skills and knowdge they have solved the problem
  2. Candidate has seen this problem or this type of problem before and just went to the solution they already knew.
  3. Candidate has no knowledge of the problem at all and went with any of the possible ways to try to solve it and just picked the correct one arbitarily.

Ways to circumvent this bais:

Rather than going over the problem objectively get the subjective view of the candidate and try to get the logic and resoning behind the approch.

I am Mohammed Lakkadshaw a full stack javascript developer. 

How to hire a freelance developer.

Introduction

Finding a developer to build an idea is very hard.

Especially when you yourself don’t know how to code.

And with so many options like going for a solo developer or a team or going for development companies, its easy to get lost in the buzz.

Well, I am here to help, so let’s move on to our journey to find the best developer for you. Here are a list of stuff you are going to learn

2 Types of developers

Price is not equal to quality.

Communication is important

How to judge if you don’t know how to code

Past projects

Open source

Blog

Freelance Website: good or bad

Finding developers on the open web

Final words: time, money, energy and project scope

Introduction

Finding a developer to build an idea is very hard.

Especially when you yourself don’t know how to code.

And with so many options like going for a solo developer or a team or going for development companies, its easy to get lost in the buzz.

Well, I am here to help, so let’s move on to our journey to find the best developer for you:

2 Types of developers

For anything above a very simple app you will require 2 kinds of developers namely

  1. 1. Front end developer
  2. 2. Back end developer

Front end developer develops the user interface of an app name how the app will look. What will be the user flow of the app.

Basically the user interface wether it is web based mobile or desktop based it is developed by the front end developer.

Back end developer developes the back end infrastructure of an app. 

Request for pages from the server storeing information in the datebase. Loging in the user and functions like these

Full stack developer: there are full stack developers as well whoare proficient in bith the front and the back end infrastructure of an app

So, if you are building an app you will atleast require one full stack developer or ane front end and one back en developer.

In the next section we will look at wjere to find these developers

Solo developers, marketplaces or companies

While looking for developers we have basically three options

  1. 1. Solo developers
  2. 2. Marketpalse
  3. 3. Companies
  1. 3. Marketplaces: there are marketplaces like Upwork, freelancer.com or people her hour where you can find developers.

These marketplaces take a cut and become a place where you can get deelopers and developers can get clients.

You can find good developers here but you need to look out for some things

Where a project comes on these sites, a number of developers bid on it and often it becomes a bidding war to become the cheapest.

It is not a good practise because developers bid low prices to get the work and then use sneakily practises to raise the cost of the project and earn money.

To say the least there is not a lot of honesty here. 

Another point of contention is that newbies with very little knowledge and almost no experience come on these platform and bid really really low.

Ask for past experiences and projects and keep in mind communication is really very important when you are hiring from here.

If the developers aren’t good in language and cannot understand what you are explaining skip them, cause minor misunderstand develop into huge costs later on.

Nowadays, premium marketplaces have also sprug up that claim to have good quality developers.

Places like Toptal and Crew charge huge amount compared to places like Upwork and freelancer

But how good quality do they offer as compared to the price premium needs to verified.

As far as marketplaces are concerned Upwork has the largest market share.

Solo developers: 

Another way of finding good developers is going for solo developers for finding them go to sites like stack overflow and open source projects on git hub.

In github look for projects similar to yours.

Those who have a good reputation on stack overflow and lots of open source projects on git hub are generally good developers. These developrs generally have their hands full and might come as expensive.

But if a developer has done stellar work and has good reputation they come out as a are generally cheaper in the long run give good results and complete the project on time

Price is not equal to quality.

One thing you must also understand is the at price is mot quality.

Programming is a skill that is not easily judged, those who can market command good rates those who can’t earn less, that doesn’t mean that they are less skilled.

Like in any other area of expertise if you want to save money you will need to find people who are skilled and ask for less money, the more time and expertise you have the more money you save

How to judge if you don’t know how to code

Ask for past projects

Ask for open source projects

Ask What is the process and time line for delivering work

Ask if they have a blog and

If they have a reputation on stack overflow

Also do some reseach about the technologies involved so the at you are better abelto talk to them.

Choosign between marketplaces:

If you have decided to go with market places I have categorised them as 

Cheap

Freelancer.com

peopleperhour

Only go to these sites if you need some thing small and insignificant built. developers are dirt cheap but lack in qouality and worksmanship.

Make a fixed budget and dont go over that, it is easy to lose a lot of money and dont gain anything here. 

As much as possible have detailed specifications ready, and if you find something sneaky just back off.

In the middle

Upwork

There are good as well as bad developers here. Just hire someone who already has some experience in the work you want done. and have details specifications ready

Expensive

Toptal 

Crew

In here they charge a lot of money but you get a personalised manager who finds you the suitable developer for you needs. You dont need a lot of details specs here but they charge a lot more.

And personally I think you dont get the quality for the money you are paying

Coding tests.

There are a lot of companies these days that offer coding tests as a way to judge potential hires. You can subscribe to the m and use the serive to sort the developers. 

I personally belive tests dont do justice to development work there are many other aspects of being a developer than passing a test. Some things just come with experience.

Always remember to ask the developer the scale of projects they have done.

How many users their previous app or web application handled.

How much money did the startups that they work for made. Were the previous projects the developer worked for successful. 

this will give you a general idea what kind of person you are hiring.

You can also consider hiring long term remote developers from sites like

digital  nomad

weworkremotely.com

stackoverflowjobs

More importantly try to make a process for hiring developers:

Technologies you require

expertise they must have 

and always tap into muliple markets for talent the more resources you have the better you will fare

Companies:

Lastly you can approach the web development compnies there arwe dime a dozen web development companies. Ranging from low cost to facncy 

As a general rule hiring a companies are 10x factor more expensive than hiring  an independent developer. 

Companies don’t really produce better code that independent developers but are a less of a hassle if you have a lot of money and are able to find a good company that doesn’t rip you off

In evaluating companies they generally show designs of their apps to you.

Always ask for complexity of the projects and how they pulled it off

Final words:

What is the scope of oyur project. Do you need a prototype to show to investors. Is you the app development centraltp your startup.

Is the project long or short term complicated or simple all come into play while deciding whixh way to go

A good deal is an equation below:

Good Deal = Money X Time X Knowledge (energy)

Keep in mind a good deal is a multipler and not an addition of time, money and energy and not an addition. If you are serioudly lacking in one of these. You are going to geta Bad deal no doubt about it.

Freelance Website: good or bad

Finding developers on the open web

Final words: time, money, energy and project scope.

Hi, I am Mohammed Lakkadshaw a freelance full stack javascript developer for more information about me please visit my blog and website: https://www.mohammedlakkadshaw.com

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 (squareup.com)
  2. Flywire (flywire.com)
  3. Moneris (Moneris.com)
  4. PayPal
  5. Stripe
  6. 2Checkout
  7. Shopify payments
  8. Amazon Payments (US only)
  9. TD Bank portal

Stripe:

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

Fees:

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

Mobile:

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 

Payouts

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

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

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:

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

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

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

Features:

  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.

Privacy:

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)

Investment

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.

Investment

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.

Solution: 

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

Solution:

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.

Solution:

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. 

Solution:

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.

Solution:

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

Conclusion:

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: https://www.mohammedlakkadshaw.com

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

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 Rocket.chat on a website, and when the user login to the website, they will also get automatically logged-into Rocket.chat

The following steps have to be performed:

  1. Check if the user exists in Rocket.chat
  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:

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.

Conclusion

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 (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 mnow.io and edited the code to generate short 6 digit meeting ids, so the new meeting URL became much cleaner e.g https://mnow.io/345686 instead of the original https://app.deadsimplescreensharing.com/meeting/bgasGca-1

But I needed a new SSL certificate for the domain mnow.io, 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 ‘domain1.com’ and ‘domain2.com’ 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 http://deadsimplescreensharing.com 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.