Skip to content

Instantly share code, notes, and snippets.

View Abhinay-g's full-sized avatar
🎯
Focusing

Abhinay Abhinay-g

🎯
Focusing
  • ABB
  • India
View GitHub Profile
@Abhinay-g
Abhinay-g / Microservices
Created July 14, 2020 04:57
Microservices
======================================================================
source: https://dzone.com/articles/6-data-management-patterns-for-microservices-1
Data Management Patterns for Microservices in Microservice Architecture
Database Per Service:
In this pattern, each microservice manages its own data. What this implies is that no other microservice
can access that data directly. Communication or exchange of data can only happen using a set of well-defined APIs.
Saga Pattern:
The Saga pattern is the solution to implementing business transactions spanning multiple microservices.
@Abhinay-g
Abhinay-g / Angular Amazing Article
Last active May 14, 2020 12:43
Angular Amazing Article
[Directive]
https://medium.com/swlh/anatomy-of-angular-attribute-directive-selector-a1d83a73242
[Virtual Table]
https://github.com/diprokon/ng-table-virtual-scroll/blob/master/projects/ng-table-virtual-scroll/src/lib/fixed-size-table-virtual-scroll-strategy.ts
https://stackblitz.com/edit/nahgrin-virtual-scroll-table?file=src%2Fapp%2Ftable%2Ftable.component.ts
[Custom Form Control]
In order to register a Angular component as a Form Control we need to implement ControlValueAccessor and we tell angular that current
component is Custom form control by adding to NG_VALUE_ACCESSOR provider token
@Abhinay-g
Abhinay-g / ES6 module system
Created February 19, 2020 07:32
ES6 module system
Referance : https://exploringjs.com/es6/ch_modules.html
Modules are singletons. Even if a module is imported multiple times, only a single “instance” of it exists.
@Abhinay-g
Abhinay-g / temp
Created August 26, 2019 18:00
temp
<!-- <router-outlet></router-outlet> -->
<div >
<div >
<mat-toolbar color="primary" class="example-hSeader">
<button mat-icon-button >
<mat-icon>menu</mat-icon>
</button>
<h1>Application Portal</h1>
</mat-toolbar>
@Abhinay-g
Abhinay-g / Azure MEAN stack developer
Created August 2, 2019 05:39
Azure MEAN stack developer
Introduction
As an Application Developer, you will lead IBM into the future by translating system requirements into the design and development of customized systems in an agile environment. The success of IBM is in your hands as you transform vital business needs into code and drive innovation. Your work will power IBM and its clients globally, collaborating and integrating code into enterprise systems. You will have access to the latest education, tools and technology, and a limitless career path with the world's technology leader. Come to IBM and make a global impact!
Your Role and Responsibilities
Who you are:
As MS Cloud Developer, you will be responsible to work with client and project managers to interpret business requirements with experience in building / architecting cloud based applications. Using Agile methodologies, you will be working in an innovative cross-functional team responsible for using cutting edge technologies to enhance and support web based analytical solutions.
What you will
@Abhinay-g
Abhinay-g / Javascript: Variable hoisting
Last active July 15, 2019 07:41
Javascript: Variable hoisting
referance : https://scotch.io/tutorials/understanding-hoisting-in-javascript
concept: all the declaration of var , let , const , function declaration, class declaration is moved up in run time.
var: variable hoisted and get (initialized) default value of "undefined" [variable declared without var are added to global scope]
let/ const : variable is hoisted but not assigned to any value
function declaration: function declaration is hoisted to upward.
Note: function and variable with same name then there will be preferance given to variable assignment over but when variable declaration
only then preferance given to function declaration no matter what order they are defined
@Abhinay-g
Abhinay-g / MongoD Aggregation framework
Created May 27, 2019 18:43
MongoD Aggregation framework
Introduction:
Aggregation framework is just an alternative for a find method, here there is more controle given to find data in custom format by using
$match, $sort, $group, $project
This is type of data is only gathered for smaller audiance as we design database based on larger audiance
In aggregation we create a pipeline where in data of one operator is passed to other operator
Aggregation method:
for aggregation we use Aggrigate() method which takes multiple parameter in sequence. Note this aggregation method can take advantage of
mongodb indexes.
Note: for this tutorial persons.json is used
@Abhinay-g
Abhinay-g / MongoDB indexes
Last active September 7, 2022 13:33
MongoDB indexes
>Introduction
Indexes are to optimize read, update and delete operation.
Indexes load a extra funcnionality while inserting data into DB, mongoDb update indexes whenever a record in inserted
db.contacts.getIndexes() // to get all the indexes
> Why index are needed
By default MongoDB do COLLECTION lookup while read, update and delete operation which is time consuming in sense that
Thare is unknown number of records that match condition
records position is unknown to mongoDB , HENCE mongoDB iterate over each document looking for matching condition
Solution : we can create an index on the column which is frequently used to access records.
@Abhinay-g
Abhinay-g / MongoDB Delete
Created May 5, 2019 15:42
MongoDB Delete
Delete one or many items from collection > db.collection.deleteOne/deleteMany(--findCondition--)
Delete Collection > db.collection.deleteMAny({})
Delete Entire Collection [Admin task] >>>> db.collection.drop()
Delete entire Database [Admin TAsk] >>>> db.deleteDatabase()
@Abhinay-g
Abhinay-g / MongoDB updating Data
Last active May 5, 2019 15:05
MongoDB updating Data
>$set Operator
this is used to add update an existing field or add a new field
Sysntax : db.collection.updateOne/updateMany({--findQuery--},{$set:{fieldName:"value"}})
> $inc Operator for Increment and Decrement
this isus ed to increment / decrement the value
Systax : db.collection.updateOne/updateMany({--findQuery--},{$set:{fieldName:"value"} , $inc:{age: INCREMENT_VALUE}})
Note: $inc can be combined with other operator
IMP : You can not put $set and $inc on same field , it will throw an error ie updating and incrementing age will cause an error