Skip to content

Instantly share code, notes, and snippets.

View bigansh's full-sized avatar
🎯
Focusing

Ansh Agarwal bigansh

🎯
Focusing
View GitHub Profile
@steveruizok
steveruizok / cache.ts
Last active March 31, 2023 14:43
weak map gist
export class Cache<T extends object, K> {
items = new WeakMap<T, K>()
get<P extends T>(item: P, cb: (item: P) => K) {
if (!this.items.has(item)) {
this.items.set(item, cb(item))
}
return this.items.get(item)!
}
@steveoni
steveoni / unrollthread.py
Created December 21, 2019 08:21
unroll twitter thread
import tweepy
import logging
from config import create_api
import time
from download_t import download_img,tweet_media,tweet_utube
import re
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()