Skip to content

Instantly share code, notes, and snippets.

View dabasajay's full-sized avatar
:octocat:
Insaan bano, scope bhi hai aur sukoon bhi!

Ajay Dabas dabasajay

:octocat:
Insaan bano, scope bhi hai aur sukoon bhi!
  • New Delhi, India
  • 18:49 (UTC +05:30)
View GitHub Profile
@dabasajay
dabasajay / nodes.md
Last active June 13, 2021 00:31
db/ | desc: RBAC schema

Basics

  1. Entities:
  • Resources
  • Permissions
  • Users
  • Roles or Groups
  1. Resources requires (1 or more) Permissions
  2. Roles are collection of (1 or more) Permissions
@dabasajay
dabasajay / notes.md
Last active May 25, 2021 15:01
sd/ | desc: microservices
  • Advantages

    • Diverse teams
    • More scalability as we can scale individual services as much as we want by adding more instances
    • Could provide better control over internet traffic
    • Better fault isolation as if one microservice fails, others can still operate to some/full extent
    • Smaller and faster deployments
  • Disadvantages

    • Communication between services is complex, error-prone and vulnerable to external conditions like network latency, etc.
  • Global testing is difficult as we need to make sure each individual service is up and running without issues

@dabasajay
dabasajay / docker-compose.yml
Last active March 28, 2021 06:27
others/ | desc: docker-compose.yml file
version: '3.7'
services:
redis:
image: 'redis'
ports:
# Host : Container
- 6379:6379
volumes:
- './host/data/redis:/var/lib/redis/data'
mongodb:
@dabasajay
dabasajay / questions.txt
Last active March 11, 2021 10:15
LC Solved Questions List - Done
1
2
@dabasajay
dabasajay / questions.txt
Created March 11, 2021 09:41
LC Solved Questions List - Priority Questions
1
1549
983
1538
873
827
53
1207
359
560
This file has been truncated, but you can view the full file.
{
"user_name": "",
"num_solved": 0,
"num_total": 1788,
"ac_easy": 0,
"ac_medium": 0,
"ac_hard": 0,
"stat_status_pairs": [
{
"stat": {
@dabasajay
dabasajay / netlify.md
Created March 6, 2021 10:18
others/ | desc: Netlify
  • Rewrites and proxies
    • History pushstate and single-page apps
    • Proxy to another service
    • Custom headers in proxy redirects
  • Redirect options
    • HTTP status codes
    • Custom 404 page handling
    • Query parameters
    • Domain-level redirects
  • Redirect by country or language
@dabasajay
dabasajay / debug.cpp
Created March 2, 2021 11:09
others/ | desc: Debug template
#define ll long long
#define pi pair<ll, ll>
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename T, typename S> ostream& operator<<(ostream& os, const pair<T, S>& p) {os << "(" << p.first << ", " << p.second << ")";return os;}
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {os << "[";for (auto i : v) os << i << " ";os << "\b]";return os;}
template <typename T> ostream& operator<<(ostream& os, const multiset<T>& s) {os << "{";for (auto i : s) os << i << " ";os << "\b}";return os; }
template <typename T> ostream& operator<<(ostream& os, const set<T>& s) {os << "{";for (auto i : s) os << i << " ";os << "\b}";return os; }
template <typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s) {os << "{";for (auto i : s) os << i << " ";os << "\b}";return os; }
template <typename T1, typename T2> ostream& operator<<(ostream& os, const map<T1, T2>& s) {for (auto i : s) os << i << endl;return os; }
template <typename T1, typename T2> ostream& operator<<(ostream&