Skip to content

Instantly share code, notes, and snippets.

View SyedAhkam's full-sized avatar
🧠
Never Stop Learning

Syed Ahkam SyedAhkam

🧠
Never Stop Learning
View GitHub Profile
@SyedAhkam
SyedAhkam / ip-on-oled.py
Created December 19, 2022 18:14
Display all network interfaces' IP address on an I2C OLED screen connected over GPIO
""" Display all network interfaces' IP address on an I2C OLED screen connected over GPIO (mainly for a raspberry pi) """
import socket
import time
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import Adafruit_GPIO.SPI as SPI
@SyedAhkam
SyedAhkam / scrape_whatsapp_group_contacts.js
Last active August 24, 2023 12:36
Scrape whatsapp group contact numbers
// Make this false if need to remove named contacts
const REMOVE_NAMES = true;
let numbers = document.querySelector("#main > header > div:nth-child(2) > div:nth-child(2) > span").title.split(",").map(e => e.trim());
if (REMOVE_NAMES) {
numbers = numbers.filter(name => name.startsWith("+"));
}
console.log(numbers);
use std::{
fs::File,
io::Cursor,
os::fd::{FromRawFd, IntoRawFd, OwnedFd},
sync::{Arc, Mutex},
};
use ashpd::desktop::{
screencast::{CursorMode, Screencast, SourceType, Stream as AshStream},
PersistMode,
use std::os::fd::{IntoRawFd, OwnedFd};
use ashpd::desktop::{
screencast::{CursorMode, Screencast, SourceType, Stream as AshStream},
PersistMode,
};
use pipewire as pw;
use pw::{properties::properties, spa};
use spa::pod::Pod;