Skip to content

Instantly share code, notes, and snippets.

View ayoubzulfiqar's full-sized avatar
💫
Engineering

Sensei ayoubzulfiqar

💫
Engineering
View GitHub Profile
@ayoubzulfiqar
ayoubzulfiqar / env.md
Created June 12, 2025 17:56
READ ENV

Put this at the top of the file inside .env

# .env

Function to read the file

encoding = locale.getpreferredencoding()

Golang

package main

import (
	"fmt"
	"time"
)
@ayoubzulfiqar
ayoubzulfiqar / sec.py
Last active June 2, 2025 10:19
SEC:Extraction
import html
import json
import re
from bs4 import BeautifulSoup
path = "file.xml"
@ayoubzulfiqar
ayoubzulfiqar / company_tickers.json
Created May 26, 2025 13:29
Add Three Zeros befor the cik_str
This file has been truncated, but you can view the full file.
{
"0": {
"cik_str": 789019,
"ticker": "MSFT",
"title": "MICROSOFT CORP"
},
"1": {
"cik_str": 1045810,
"ticker": "NVDA",
"title": "NVIDIA CORP"
@ayoubzulfiqar
ayoubzulfiqar / playwright.md
Created May 6, 2025 17:22
Video Detection & Download Strategies using Playwright (Python)

Video Detection & Download Strategies using Playwright (Python)

To detect and download videos from a webpage's network traffic, we can intercept network requests in Playwright, identify video streams/files, and handle them appropriately. Below are different strategies to achieve this.


1. Intercepting Network Requests (Recommended)

Monitor network activity for video-related MIME types or file extensions.

@ayoubzulfiqar
ayoubzulfiqar / ReadENV.md
Created March 22, 2025 05:07
READ ENV - without any package

Read ENV

Golang

func loadEnv() error {
	file, err := os.Open(".env")
	if err != nil {
		fmt.Println("FileError:", err)
 return err
@ayoubzulfiqar
ayoubzulfiqar / user-agents.json
Created March 21, 2025 08:05
UserAgents to Use,
[
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 115Browser/27.0.7.5",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 115Browser/27.0.6.9",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 115Browser/27.0.6.3",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/49.0.2623.75 Safari/537.36 115Browser/7.0.0",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 115Browser/24.0.2.2",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 115Browser/25.0.2.1",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 115Browser/25.0.6.5",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0
@ayoubzulfiqar
ayoubzulfiqar / vscode_settings.md
Last active September 20, 2025 07:16
VSCode WorkBech JSON Profiles Custom Settings

Custom Profile

Default

{
  "workbench.colorTheme": "Tokyo Night",
  "workbench.colorCustomizations": {
    "editor.background": "#000000",
    "sideBar.background": "#000000",
@ayoubzulfiqar
ayoubzulfiqar / free-database-hosting.md
Created February 15, 2024 09:18 — forked from bmaupin/free-database-hosting.md
Free database hosting
@ayoubzulfiqar
ayoubzulfiqar / advent_of_code_day1.md
Last active December 5, 2023 12:14
Advent Of Code - Day 1 - Trebuchet (Go, Dart, TypeScript)

Day 1: Trebuchet

Code: Golang

// SumCalibration reads a file named "input.txt", calculates the calibration
// values for each line by combining the first and last digits, and returns
// the sum of all calibration values.
func SumCalibration() (int, error) {
	// Open the file for reading