Skip to content

Instantly share code, notes, and snippets.

View ayoubzulfiqar's full-sized avatar
💫
Lord of Mysteries

Sensei ayoubzulfiqar

💫
Lord of Mysteries
View GitHub Profile
@ayoubzulfiqar
ayoubzulfiqar / app.tsx
Last active July 31, 2025 18:06
Need Refining Website for SI.yk
import React, { useState, useEffect, useRef } from 'react';
import { ChevronDown, Twitter, Linkedin, Instagram, Facebook } from 'lucide-react';
// Use this to ensure icons work.
// For the purpose of this self-contained immersive, we'll assume 'lucide-react' is available.
// =============================================================================
// Helper Components (to keep the main App component clean)
// =============================================================================
@ayoubzulfiqar
ayoubzulfiqar / sould.md
Last active July 31, 2025 13:57
ShouldHide and DO at the END

You cannot completely hide files like .tsx source code or JSON responses from users who have access to browser developer tools, but you can make them much harder to access and understand. Here are practical approaches:


1. For TypeScript/TSX Files

A. Build and Bundle Your Code

  • Why: Raw .tsx files exist only during development. In production, they should be compiled to JavaScript and bundled.
  • How:
@ayoubzulfiqar
ayoubzulfiqar / directvideodownload.md
Created July 31, 2025 10:12
Dirct Download Button

Solution 1: Fetch + Blob (Optimized for Streaming)

const handleDownloadClick = useCallback(async (url: string, formatExt: VideoFormat) => {
    const title = videoInfo.title;
    const filename = `${title.replace(/[^a-z0-9\-_ ]/gi, '').replace(/\s+/g, '_') || 'download'}.${formatExt.ext}`;

    try {
        console.log('Starting download for:', filename);
@ayoubzulfiqar
ayoubzulfiqar / SoundEffect.ps1
Created July 11, 2025 07:21
Make Error When Script Run To Error
# Function to play a sound file
function Play-ErrorSound {
param (
[Parameter(Mandatory=$true)]
[string]$SoundFilePath
)
# Check if the sound file exists
if (-not (Test-Path $SoundFilePath -PathType Leaf)) {
Write-Warning "Sound file not found: $SoundFilePath. Cannot play alert."
@ayoubzulfiqar
ayoubzulfiqar / jsonevr.go
Created June 20, 2025 07:30
This is a simple script which host/serve the remote as well as LOCAL json file
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"net"
"net/http"
@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.