Skip to content

Instantly share code, notes, and snippets.

View ranajahanzaib's full-sized avatar

Rana Jahanzaib ranajahanzaib

View GitHub Profile
@ranajahanzaib
ranajahanzaib / decision-checklist.md
Created March 27, 2026 13:31
Decision Checklist for New Project

Decision Checklist for New Project

Question Answer? Implication
Do I need deterministic memory usage and zero‑copy performance? Yes → Consider Rust.
No → Go/Python fine.
Is the workload I/O‑bound (many concurrent connections, network, DB queries)? Yes → Node.js (event‑driven) or Go (goroutine pool).
Is the workload CPU‑heavy and parallelizable? Yes → Rust (or Go with many workers).
Do I need to ship a single static binary for easy deployment? Yes → Go or Rust (both compile to static binaries).
Do I need a huge ecosystem of third‑party libraries (ML, data, web UI)? Yes → Python (or JS for web).
Is rapid prototyping / frequent iteration a priority? Yes → Python or JS.
@ranajahanzaib
ranajahanzaib / firebase.ts
Created February 15, 2026 13:26
Firestore with local cache
import {
initializeFirestore,
persistentLocalCache,
persistentMultipleTabManager,
} from 'firebase/firestore'
const app = initializeApp(firebaseConfig)
const auth = getAuth(app)
import React from "react";
function CollectionCard(props) {
let cols;
if (props.cols) {
cols = `col-${props.cols}`;
} else {
cols = "col-4";
}
return (
{
firstName: "Your First Name",
email: "Your Email Address",
message: "Your Message",
ip: "Your IP Address"
}
@ranajahanzaib
ranajahanzaib / main.cpp
Created March 18, 2019 15:30
Having Trouble with MySQL Connectors
#include <iostream>
#include <stdlib.h>
#include <mysql-cppconn/jdbc/mysql_connection.h>
#include <mysql-cppconn/jdbc/cppconn/driver.h>
#include <mysql-cppconn/jdbc/cppconn/exception.h>
#include <mysql-cppconn/jdbc/cppconn/resultset.h>
#include <mysql-cppconn/jdbc/cppconn/statement.h>
using namespace std;