Skip to content

Instantly share code, notes, and snippets.

View nikkaroraa's full-sized avatar
๐Ÿ‘จโ€๐Ÿ’ป
building!

nikhil nikkaroraa

๐Ÿ‘จโ€๐Ÿ’ป
building!
View GitHub Profile
@nikkaroraa
nikkaroraa / rebindThisFatArrow.js
Last active November 26, 2017 16:31
Rebind "this" (Fat-Arrow)
//Fat-Arrow syntax
var blog = {
name: 'The School Of JS',
topics: ['DOM', 'JS'],
about: function () {
return this.topics.map(topic => topic + ' is a topic of ' + this.name + ' blog!');
}
};
blog.about();
@nikkaroraa
nikkaroraa / .vscode
Created March 4, 2018 05:20
VS Code User-Settings
{
"workbench.colorTheme": "Cobalt2",
"files.autoSave": "onFocusChange",
"editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 17,
"editor.lineHeight": 25,
"editor.letterSpacing": 0.5,
"files.trimTrailingWhitespace": true,
"editor.fontWeight": "400",
"prettier.eslintIntegration": true,
@nikkaroraa
nikkaroraa / async.js
Created May 3, 2018 14:30
Callbacks, Promises and Async/Await
// The Problem
function fn(val) {
setTimeout(function() {
console.log(val)
}, val)
}
function executeAll() {
fn(20)
fn(20)
@nikkaroraa
nikkaroraa / README.md
Created May 20, 2018 17:25 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„

Starting a New Project

  1. Login to your GitHub account and create a new repository.
  2. Copy the generated URL which looks something like this: https://github.com/iamoperand/test123.git
  3. Now, create a new folder in your system.
  4. Open terminal in that location and then follow the following commands:
git init //to initialise GIT in the target location
git add --all //to add all the files (staging is what it means, done just before committing)
@nikkaroraa
nikkaroraa / epv.txt
Created June 10, 2018 06:45
EPV - Calculation
EPV(t) = E[points | d(t)] = E[points | macro in (t, t+ฮต], d(t)] ร— P(macro in t(t+ฮต] | d(t))
+ e[points | micro in (t, t+ฮต], d(t)] ร— P(micro in t(t+ฮต] | d(t))
@nikkaroraa
nikkaroraa / wtf-proto.md
Last active June 19, 2018 11:42
Things to clear up before jumping into the world of React

1. Clearing the confusion between prototype, proto and [[Prototype]]

prototype

  function Dog(name) {
    this.name = name; 
    this.speak = function() {
        return this.name + " says woof";
    }
 }
@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";
    }
  }
@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 / 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; }