Skip to content

Instantly share code, notes, and snippets.

View nikkaroraa's full-sized avatar
👨‍💻
building!

nikhil nikkaroraa

👨‍💻
building!
View GitHub Profile
@nikkaroraa
nikkaroraa / kms-encryption-command.txt
Created March 20, 2020 13:16
Google KMS encryption command
echo -n <variable> | gcloud kms encrypt --plaintext-file=- --ciphertext-file=- --location=global --keyring <keyring> --key <key> | base6
4
@nikkaroraa
nikkaroraa / createResolver.js
Created February 21, 2020 11:00
create resolver (GraphQL HOC)
const createResolver = (resolver) => {
const baseResolver = resolver;
baseResolver.createResolver = (childResolver) => {
const newResolver = async (parent, args, context, info) => {
await resolver(parent, args, context, info);
return childResolver(parent, args, context, info);
};
return createResolver(newResolver);
};
return baseResolver;
@nikkaroraa
nikkaroraa / rem-unit.md
Created March 29, 2019 17:46
rem-unit.md

What is REM in CSS?

Hey guys, I was talking to Bo and we were thinking about start using rem unit on the projects, because it's more responsible.

The main difference between rem and em is that em is relative to element's closest parent font-size, e.g:

HTML:

@nikkaroraa
nikkaroraa / lifecycle-of-web-app.md
Created March 29, 2019 17:41
lifecycle-of-web-app.md

Lifecycle of a web-app

Browser-side and Server-side

Client makes a request from the browser which then goes to the server to fetch some resources. The server is a really complex thing that does all the logic handling, computations and provides us with the things that we eventually want to show on the website. That covers authorization, authentication and interaction with the database. Authentication

  • Authentication is the process of verifying who you are. When you log on to a PC with a user name and password you are authenticating.
@nikkaroraa
nikkaroraa / aws.md
Created March 29, 2019 17:39
aws.md
@nikkaroraa
nikkaroraa / docker-help.md
Created August 25, 2018 18:21 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@nikkaroraa
nikkaroraa / this-in-function.md
Last active June 19, 2018 12:57
Things to clear up before jumping into the world of React

4. How "this" keyword works with functions JS

To access any variable or any method that is a part of a JavaScript object, we use "this" keyword.

For example,

function Dog(name) {
 if (name) { this.name = name; }
@nikkaroraa
nikkaroraa / super.md
Last active June 19, 2018 11:51
Things to clear up before jumping into the world of React

3. How "super" keyword works in JS

The main issue that we will come across in React is the usage of "this" in constructor.

This issue can be summarised as follows:

The JS engine only attaches an object instance to the context variable (this) once you get to the highest prototype in the chain - which is Object

@nikkaroraa
nikkaroraa / new-keyword.md
Last active June 19, 2018 11:41
Things to clear up before jumping into the world of React

2. How "new" keyword works in JS

  function Dog(name) {
    if (name) { this.name = name; }
    this.speak = function() {
        return this.name + " says woof";
    }
  }