Skip to content

Instantly share code, notes, and snippets.

View tk120404's full-sized avatar
🎯
Focusing

Arjunkumar tk120404

🎯
Focusing
View GitHub Profile
*Handling performance for Progressive Web Apps at scale: Flipkart
PRPL
<link rel="preload">
https://developers.google.com/web/updates/2016/03/link-rel-preload?hl=en
requestAnimationFrame(function(){
performance.mark('first paint')});
https://developers.google.com/web/fundamentals/performance/critical-rendering-path/analyzing-crp?hl=en
First slide: tiny.cc/nxtgen
@tk120404
tk120404 / india.js
Last active October 4, 2016 13:23
Prints India Map as shown below in the india.txt node india.js
var a,b=0,c=10,qwer ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
while ((a = qwer.charCodeAt(b++)) != 0) {
while (a-- > 64) {
require('sys').print( ++c==90 ? String.fromCharCode(c = c/ 9):String.fromCharCode(33^b&1));
}
}
//Source : http://codepad.org/ngiITeZ4
@tk120404
tk120404 / linkedlist.js
Last active October 4, 2016 13:45
LinkedList implemenation in Javascript
var LinkedList = function()
{
this._head = this._tail = null;
this._transverse = null;
this._size = 0;
}
function QEntry(prev, obj, next)
{
if (typeof obj === 'undefined' || obj === null) {
@tk120404
tk120404 / decimalAdjust.js
Created March 2, 2017 12:32
decimal Adjustment in javascript
function decimalAdjust(value)
{
value = value.toString().split('e');
value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + 2) : 2)));
value = value.toString().split('e');
return +(value[0] + 'e' + (value[1] ? (+value[1] - 2) : -2));
}
@tk120404
tk120404 / nginx-websocket-proxy.conf
Created January 20, 2018 14:46 — forked from uorat/nginx-websocket-proxy.conf
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;

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.

Array<T>

Legend:

  • ✏️ method changes this.
  • 🔒 method does not change this.

Array<T>.prototype.*:

  • concat(...items: Array: T[] 🔒 ES3
@tk120404
tk120404 / gamedata.txt
Created January 28, 2014 10:16
Temple run 2(Android) cheat. No root required. Open any file Explorer (like ES File Explorer) and navigate to /sdcard/Android/Data/com.imangi.templerun2/files/. Replace this gamedata.txt content with this file content
{"hash":"f3752abd2fbd9f1b706100325cd31542","data":{"version":7,"Players":[{"v":2,"pid":1,"bestScore":6397395,"bestScoreNoResurrection":3275168,"bestCoinScore":6478,"bestSpecialCurrencyScore":63,"bestDistanceScore":14459,"lifetimePlays":327,"lifetimeCoins":250027,"lifetimeSpecialCurrency":176,"lifetimeDistance":827577,"coinCount":12879,"specialCurrencyCount":26,"activePlayerCharacter":8,"gameCenterNeedsUpdate":true,"artifactsPurchased":[0,5,25,20,6,10,35,21,15,11,1,2,16,3,12,26,27,22,30,13,40,17,7,8,9,31,4,18,23,28],"artifactsDiscovered":[],"objectives":[2,1,0,5,4,44,6,7,9,3,8,49,11,48,16,12,10,18,14,17,23,24,21,50,22,15,13,52,20,19,28,26,25,27,43,31,32,30,46,29,45,35,33,34,53,42,36],"powersPurchased":[0,4,1,5],"randomSeed":-43418228,"numberResurectsUsed":0,"hashID":"17e20a8da3006e551f95d19a7270ed97","ldcc":0,"lwcc":0,"licc":0,"iappc":0,"iapms":0,"CollectablesFound":[{"CollectableId":18,"NumFound":7,"FoundState":"CollectFound_FoundAndViewed"},{"CollectableId":17,"NumFound":4,"FoundState":"CollectFound_FoundAnd
@tk120404
tk120404 / nodeAsyncTest.js
Created September 6, 2019 07:56 — forked from aescarcha/nodeAsyncTest.js
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
https://www.hackerrank.com/challenges/birthday-cake-candles/problem
https://www.hackerrank.com/challenges/compare-the-triplets/problem
https://www.hackerrank.com/challenges/queens-attack-2/problem
https://www.hackerrank.com/challenges/bigger-is-greater/problem