Skip to content

Instantly share code, notes, and snippets.

View vishnu-saini's full-sized avatar

Vishnu Saini vishnu-saini

View GitHub Profile
# Setting up react application
• Update npm to npm6+
npm install -g npm
• Setting up a basic react application
npm init react-app ptim-app
• Setting up material ui in react app

Linting - Linting is the process of checking the source code for Programmatic as well as Stylistic errors. This is most helpful in identifying some common and uncommon mistakes that are made during coding. ESlint is a JavaScript linting tool. Prettifying – formatting the code (similar to ctrl+shift+f in eclipse). Prettier is a well know prettifying tool in JavaScript community.

Integrating Eslint & Prettier in React

  1. Installing and using ESlint in a JavaScript project. (Specific to JS project)

https://eslint.org/docs/user-guide/getting-started

  1. Installing and using ESlint along with Code prettier in a react-redux application and extending Airbnb’s style guide.
import React, {Component} from "react";
import ReactDOM from "react-dom";
export default class PartialMatchFilter extends Component {
constructor(props) {
super(props);
this.state = {
text: ''
};

Data Structures

  • Array
  • Linked List
  • Stack
  • Queue
  • Binary Tree
  • Binary Search Tree
  • Heap
  • Hashing

Java Inner Class

Java inner class is defined inside the body of another class. Java inner class can be declared private, public, protected, or with default access whereas an outer class can have only public or default access.

Java inner classes are divided into 4 categories

  • Static inner class
  • Non-static java inner class
  • Method local inner class
  • Anonymous inner class

Static inner class

Concurrency

Concurrent applications also make optimal use of the processors. But concurrent applications are difficult to develop, maintain, and debug. To develop thread-safe, high-performance, and scalable applications, Java’s low-level threading capabilities are insufficient.

Concurrent collection classes

The java.util.concurrent package includes a number of additions to the Java Collections Framework. These are most easily categorized by the collection interfaces provided:

  • BlockingQueue defines a first-in-first-out data structure that blocks or times out when you attempt to add items to a full queue, or retrieve from an empty queue.

HTML5

What is New in HTML5

The DOCTYPE declaration for HTML5 is very simple:

<!DOCTYPE html> 

The character encoding (charset) declaration is also very simple:

<meta charset="UTF-8">

CSS Important Properties

CSS Colors

  • Color Names
  • RGB
  • HEX
  • HSL
  • RGBA
  • HSLA values

1. Color Names

Redux Notes

What is Redux

Redux is one of the hottest libraries for front-end development in today’s marketplace. It is a predictable state container for JavaScript applications and is used for the entire applications state management. Applications developed with Redux are easy to test and can run in different environments showing consistent behaviour image

Three principles of Redux

  • Single source of truth: The state of the entire application is stored in an object/ state tree within a single store. The single state tree makes it easier to keep track of changes over time and debug or inspect the application.
  • State is read-only: The only way to change the state is to trigger an action. An action is a plain JS object describing the change. Just like state is the minimal representation of data, the action is the minimal representation of the change to that data.
  • **Changes are