Skip to content

Instantly share code, notes, and snippets.

View abir-taheer's full-sized avatar
🇵🇸
voice for the voiceless

Abir Taheer abir-taheer

🇵🇸
voice for the voiceless
View GitHub Profile
@abir-taheer
abir-taheer / useSnapshotQuery.ts
Last active March 2, 2024 13:00
Hook to allow for listening to cloud firestore snapshot updates with react-query for any type of object
import {
DocumentData,
DocumentReference,
Query,
onSnapshot,
QuerySnapshot,
DocumentSnapshot,
} from "@firebase/firestore";
import { useCallback, useEffect, useMemo, useRef } from "react";
import {
@abir-taheer
abir-taheer / instagram-follower-following.js
Last active April 19, 2024 12:22
"This is our community, this is our family, these are our friends." https://www.youtube.com/watch?v=gk7iWgCk14U&t=425s
if (window.location.origin !== "https://www.instagram.com") {
window.alert(
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.",
);
window.location.href = "https://www.instagram.com";
console.clear();
}
const fetchOptions = {
credentials: "include",
@abir-taheer
abir-taheer / sorted_dict.py
Last active June 12, 2023 21:54
Explanation of SO answer for Emperor Wafi
sortedrows = {
# k: v were replaced with key and value, respectively to make it easier to follow
key: value
# enumerate through the sorted
for key, value in sorted(
rownums.items(),
key=lambda item: item[0]
)
}