Skip to content

Instantly share code, notes, and snippets.

View kepta's full-sized avatar
🐒
What

Kushan Joshi kepta

🐒
What
  • Toronto
View GitHub Profile

In this article I will take a very simplistic approach in understanding memory leaks and I will also attempt to diagnose them.

In todays world of abundant memory, we seldom worry about memory leakages. But I hate to tell you that we live in a real world and nothing comes for free.

Oh my fancy functional programming

Disclosure: I absolutely love functional programming. Functional programming is cool and with the new ES6 syntax it becomes even cooler.

@kepta
kepta / kj
Created December 12, 2020 08:14
sdsd

The Draft library includes default block CSS styles within DraftStyleDefault.css. (Note that the annotations on the CSS class names are artifacts of Facebook's internal CSS module management system.) skdlsa saljdlaskd

Promising Promise Tips

Promises are great to work with! Or so does your fellow developer at work says.

prom

This article would give you to the point no bullshit tips on how to improve your relationship with the Promises.

You can return a Promise inside a .then

@kepta
kepta / memory-3.js
Last active February 5, 2018 05:12
for(var i = 0; i < newData.length; i++) {
for(var j = 0; j < i; j++) {
// stuff here
}
}
function sayHi() {
var allNames = [];
var emoji = '👋';
return name => {
allNames.push(name);
return emoji + name;
}
}
function sayHi() {
var allNames = [];
var emoji = '👋';
return name => {
allNames.push(name);
return emoji + name;
}
}
var x = [ [1] ];
for(var i = 1; i < 100000; i++) {
x.push(arrayAddFirst(i, x[i-1])); // Warning! do not try this at home
}
var x = 0;
while(x < 5) {
console.log(x); // Warning! do not try this at home
}