Skip to content

Instantly share code, notes, and snippets.

View maifeeulasad's full-sized avatar
🤒
unwell

Maifee Ul Asad maifeeulasad

🤒
unwell
View GitHub Profile
@maifeeulasad
maifeeulasad / converter.py
Created April 21, 2021 11:30
Tensorflow Lite | Android | Keras | model converter
import tensorflow as tf
model = tf.keras.models.load_model('name_gender.h5')
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
//maybe the worst implementation
const delay = ms => new Promise(res => setTimeout(res, ms));
for(let i=0;i<100;i+=1){
if(i%4===0){
console.log("4");
}
if(i%7===0){
console.log("7");
}
await delay(1000);
@maifeeulasad
maifeeulasad / yt-wl-list.js
Last active December 15, 2025 09:01
List all youtube videos in watch later playlist, it can work with other playlist as well
setInterval(function () {
const data = []
// all videos, we need to scroll to the bottom of the page to load all videos (manually)
const videoLinks = document.querySelectorAll(
'a#video-title.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer'
);
videoLinks.forEach(videoLink => {
const title = videoLink.getAttribute('title');
// we can do it for facebook as well :wink:
@maifeeulasad
maifeeulasad / askubuntu-runner.py
Created July 14, 2025 16:47
maifeeulasad/askubuntu-runner.py
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
from peft import PeftModel
base_model_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
peft_model_id = "maifeeulasad/askubuntu-model"
model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(model, peft_model_id)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
@maifeeulasad
maifeeulasad / facebook-unsave-all.js
Created August 7, 2025 07:36
facebook unsave all or remove all item from saved for later
(async () => {
// Helper to wait a given number of milliseconds
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
// Find all target elements with the specific outer div class
const elements = Array.from(document.querySelectorAll(
'.html-div.xdj266r.xat24cr.xexx8yu.xyri2b.x18d9i69.x1c1uobl.x6s0dn4.x78zum5.xl56j7k.x14ayic.xwyz465.x1e0frkt'
));
console.log(`Found ${elements.length} elements. Starting from the last.`);
@maifeeulasad
maifeeulasad / safetensors-benchmarking-withand-without-gds.ipynb
Last active December 12, 2025 17:06
safetensors-benchmarking.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.