Skip to content

Instantly share code, notes, and snippets.

View foyez's full-sized avatar
🎯
Focusing

Kazi Foyez Ahmed foyez

🎯
Focusing
View GitHub Profile
@jesstelford
jesstelford / README.md
Last active November 14, 2023 12:26
Starving the Event Loop with Microtasks

Starving the Event Loop with microtasks

"What's the Event Loop?"

Sparked from this twitter conversation when talking about doing fast async rendering of declarative UIs in Preact

These examples show how it's possible to starve the main event loop with microtasks (because the microtask queue is emptied at the end of every item in the event loop queue). Note that these are contrived examples, but can be reflective of situations where Promises are incorrectly expected to yield to the event loop "because they're async".

  • setTimeout-only.js is there to form a baseline
@jesstelford
jesstelford / event-loop.md
Last active October 16, 2025 15:48
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@vasanthk
vasanthk / System Design.md
Last active December 15, 2025 13:51
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@pratikmurali
pratikmurali / Coding Interviews prep
Last active November 29, 2015 17:41
Collection of useful links to prepare for programming interviews
Big O Cheatsheet: http://bigocheatsheet.com/
Introduction to Competitive Programming Contests: http://web.stanford.edu/class/cs97si/
Another Competitive Programming Course: http://algo.is/competitive-programming-course/
TopCoder Tutorials : https://www.topcoder.com/community/data-science/data-science-tutorials/
Leetcode Articles: http://articles.leetcode.com/
Indian Computing Olympiad: http://www.iarcs.org.in/inoi/online-study-material/
Dynamic Programming :http://20bits.com/article/introduction-to-dynamic-
Datastructures/ Algorithms Code Library :http://kaidul.com/algorithm-data-structure-code-library/
Fenwick Trees: http://notes.tweakblogs.net/blog/9835/fenwick-trees-demystified.html
Algorithm Gym: http://codeforces.com/blog/entry/15729
#include <bits/stdc++.h>
using namespace std;
#define SZ(a) int((a).size())
#define PB push_back
#define ALL(c) (c).begin(),(c).end()
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,a) FOR(i,0,(a)-1)
#define FORD(i,n,a) for(int (i)=(n);(i)>=a;(i)--)