Skip to content

Instantly share code, notes, and snippets.

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

nikhil nikkaroraa

👨‍💻
building!
View GitHub Profile
@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 / 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))

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 / 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: 😄

@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 / .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 / 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 / rebindThisOld.js
Last active November 26, 2017 16:31
Rebind "this" (Old syntax)
//Old syntax
var blog = {
name: 'The School Of JS',
topics: ['DOM', 'JS'],
about: function () {
return this.topics.map(function (topic) {
return topic + ' is a topic of ' + this.name + ' blog!';
});
}
};
@nikkaroraa
nikkaroraa / thisKeyword.js
Created November 26, 2017 15:42
this keyword
function globalFunction() {
console.log(this);
}
globalFunction(); //[object Window]
//globalFunction() is equivalent to window.globalFunction()
var myObj = {name: "obj"};
myObj.logThis = function () {
console.log(this);
@nikkaroraa
nikkaroraa / implicitReturn.js
Last active November 26, 2017 12:26
Implicit Return (Fat-Arrow)
//Old syntax
var name = function returnName (id) {
return editors[id].name;
}
//Fat-Arrow syntax
var name = id => editors[id].name; //implicit return