Image for post
Image for post
Photo by Kelly Sikkema on Unsplash

JavaScript is a dynamic language. This makes JavaScript a supercool language to start. However, It is very hard to write better and safe code. One small mistake can lead to a bigger issue. Error handling plays a vital role to reduce the number of bugs. If you handle error elegant way, it will save a lot of time in the future. So the bigger question is how you should handle the error.

Let’s take one example.

const express = require("express")
const app = express()
app.get("/", (_, res) => res.end("OK"))
app.listen(80)

The above code is a sample code written in nodejs…


Image for post
Image for post
Photo by Jeff Sheldon on Unsplash

JS|TS By Example

Top 10 Utilities you may need for your TypeScript Projects

You work on multiple projects. Most of the time you repeat your self while writing common util functions. Here are some of the most useful utilities that you can use for your TypeScript or JavaScript

1. compact: Compact is normally used to remove the falsy value from an Array. There are multiple variations of it.

Simple Variant: filter out falsy values (false, null, 0, "", undefined, and NaN).

// Code:
const compact = (arr = []) => arr.filter(Boolean);
// How to use it compact([0, 1, false, 2, "", 3, "a", Number("e") * 23, NaN, "s", 34]); //…


Image for post
Image for post
PC: embroker

For the past few years, I have almost stopped writing JavaScript. You may ask why. It doesn't mean I don't like JavaScript. However, there is a better version of JavaScript, TypeScript. Yes, I have started developing all my library and application in TypeScript. It includes the backend too.

Here in this article, I will try to answer the question of why you should use TypeScript instead of JavaScript. This article does not cover the pros and cons of JavaScript. Rather than just focus on Good Parts of TypeScript.


Image for post
Image for post
Kotlin Logo

Writing a command-line app is a challenge in many object-oriented languages. Most the object-oriented languages need heavy lifting structure(source code) to run a simple program. Java/Kotlin is one of them. Here, Gradle comes to save us.

Gradle is a framework helping us to create and maintain big applications. Gradle is awesome. However, setting up Gradle is also a tedious task. Here I will show step by step setup to build a scalable CLI(Command Line Interface) tool in Kotlin.

Prerequisite:

  1. Java 1.8 and above
  2. Gradle 5.5.1 and above(Gradle which supports Kotlin DSL)

Step 1: Create a multi-module Gradle project

Create a folder and scaffold the structure with Gradle.

mkdir…


Part 1: Strings

This is the first part of a series of articles that will help you to prepare for coding challenges. In this article, I will focus on the problems related to JavaScript strings.

Prerequisite: Before going forward, I am assuming you should have basic knowledge of JavaScript. At least you should know how it works.

Note: This is not a copy of Gayle_Laakmann’s book. The book is awesome. I love reading it whenever I get time. However, some samples/questions are taken from the book. While the book solves problems using Java, I have solved the same questions with JavaScript (TypeScript).

Strings


There are a lot of tutorials to create Apollo Server and adding typing to it. However, creating a better project structure requires in-depth knowledge of NodeJs and Apollo Server. Here in this article, I will explain the step-by-step process to build a robust and scalable server.

Image for post
Image for post
Photo by Brian McGowan on Unsplash

Prerequisite:

Before going further, I assume you have basic knowledge of NodeJs and TypeScript. If you are new to NodeJs, Please have a look at some basic tutorials on nodejs.

1. Start a project using TypeScript CLI

First, We need to create a project and init the configuration.

## Create a folder
md apollo-server
cd apollo-server
## Init npm package
npm init…


Image for post
Image for post
Photo by Sigmund on Unsplash

Creating a better UX is not as simple as it looks. Every component on-page matters. While working on a complex piece of code, we almost forgot about the simplest thing, a broken image.

Here in this tutorial, I will explain how you can create a simple Image component without breaking existing code. This component will support lazy loading and broken images.

1. Create an Image Component

To start with, first create a folder in your component library and create a file named index.tsx.

mkdir -p components/Image
touch components/Image/index.tsx

Add below line to index.tsx.

// components/Image/index.tsx

import React from "react";
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {}export…


Image for post
Image for post
Photo by Timelab Pro on Unsplash

Deno By Example

Run Deno Application on Docker | Continuous Integration and Deployment

Before starting code, Let's understand the concept of CICD in brief. This will give us the motive to read this blog further.

Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.

By- ThoughtWorks’ definition for CI

Read more: https://www.thoughtworks.com/es/continuous-integration

Continuous Delivery is the ability to get changes of all types — including new features, configuration changes, bug fixes, and experiments — into production, or into the hands of users, safely…


Currently setting up a Server Side Render (SSR) application is a pain in nodejs. There are many scaffolds available for nodejs. But it comes with its own tech-depth and learning curves. This also includes hidden configurations of Webpack.

All in all, when you give Webpack a chance, your encounter will rarely be a pleasant one.

Read More: https://www.north-47.com/knowledge-base/webpack-the-good-the-bad-and-the-ugly/

1. Overview

According to the wiki, An isomorphic JavaScript(also known as Universal JavaScript) is described as JavaScript applications that run both on the client and the server.

Image for post
Image for post
https://unsplash.com/photos/c_Hi3DzlC0g

If I say, you can build an entire SSR without setting up installing any external nodejs dependency…


In the world of data, the Security of personal data is the biggest concern of anyone. Knowingly or unknowingly we share a lot of data to the company like Google and Facebook. In the old era, we have made walls/doors to protect our property from external threats. So now how far you will go to protect you and your beloved property.

In this article, I will explain how you can protect your data using some basic tips. You don't have to be super technical to protect you.

Image for post
Image for post
Photo by Austin Distel on Unsplash

Overview:

To protect your assets, First, you have to understand what assets do you…

Deepak Vishwakarma

I am UI/UX lead developer, tech enthusiastic person. I am working in one of the biggest FinTech company, trying to solve basic challenges on ground issues.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store