Skip to content

Instantly share code, notes, and snippets.

View miladj3's full-sized avatar
💭
I loved microsoft

milad jafari miladj3

💭
I loved microsoft
View GitHub Profile
@miladj3
miladj3 / cursor.sh
Last active June 12, 2025 09:17 — forked from Bishwas-py/cursor.sh
Cursor installer / uninstaller for linux, Fedora, Ubuntu, Arch or distros
#!/bin/bash
# Set default paths and URLs
DOWNLOADS_DIR="$HOME/Downloads"
APPLICATIONS_DIR="$HOME/.local/bin" # More appropriate location for AppImages
ICON_URL="https://www.cursor.com/apple-touch-icon.png"
APPIMAGE_URL="https://downloads.cursor.com/production/53b99ce608cba35127ae3a050c1738a959750865/linux/x64/Cursor-1.0.0-x86_64.AppImage"
ICON_FILENAME="cursor-icon.png"
APPIMAGE_FILENAME="Cursor-1.0.0-x86_64.AppImage"
DESKTOP_FILE="$HOME/.local/share/applications/cursor-editor.desktop"
@miladj3
miladj3 / divar_notifier.py
Created May 9, 2025 14:06 — forked from mthri/divar_notifier.py
Divar to Telegram Notifier Bot
"""
Divar to Telegram Notifier Bot
This script monitors a filtered Divar page and sends newly posted items to a specified Telegram channel every 60 seconds.
Setup Instructions:
1. Create a Telegram bot using BotFather.
2. Add the bot to your Telegram group or channel.
3. Promote the bot as an admin in your channel so it can post messages.
4. Use @username_to_id_bot to get the numeric ID of your channel (e.g., -1001234567890).
@miladj3
miladj3 / ng-update-angular-material.md
Created March 23, 2025 09:21 — forked from shhdharmen/ng-update-angular-material.md
Ultimate @angular/material update guide - All versions!
@miladj3
miladj3 / irping.sh
Created November 14, 2024 09:13 — forked from ArmanTaheriGhaleTaki/irping.sh
using https://check-host.net/check-ping ping API to check if a IP is accessible from Iran
irping() {
ip=$1
nodes=("ir1" "ir3" "ir5" "ir6")
for node in "${nodes[@]}"; do
# Make the API request and store the response
response=$(curl -s -H "Accept: application/json" "https://check-host.net/check-ping?host=${ip}&node=ir1.node.check-host.net&node=ir3.node.check-host.net&node=ir5.node.check-host.net&node=ir6.node.check-host.net")
# Check for "limit_exceeded" error in the response
error_message=$(echo "$response" | jq -r '.error')
if [ "$error_message" == "limit_exceeded" ]; then
@miladj3
miladj3 / automatic_FFMPEG_script
Created November 14, 2024 09:13 — forked from ArmanTaheriGhaleTaki/automatic_FFMPEG_script
this is a bash script that compress MP4 formatted videos in a folder automatically and name the output as [Videoname] _compressed.mp4
#!/bin/bash
VIDEOS=$(ls *.mp4)
for VIDEO in $VIDEOS
do
ffmpeg -i $VIDEO -vcodec libx265 -crf 28 -f mp4 ${VIDEO%%.*}_compressed.mp4
done
@miladj3
miladj3 / myAngular.html
Created November 2, 2024 13:08 — forked from faustinoaq/myAngular.html
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@miladj3
miladj3 / retryDynamicImport.ts
Created October 13, 2024 12:15 — forked from mberneti/retryDynamicImport.ts
This utility function retryDynamicImport enhances React’s lazy loading mechanism by adding retry logic with a versioned query parameter. It retries importing a component multiple times in case of failure, which can be useful for bypassing browser cache or dealing with intermittent network issues. It can be used as a drop-in replacement for React…
// Usage:
// Replace React.lazy(() => import('x'));
// with retryDynamicImport(() => import('x'));
import { ComponentType, lazy } from 'react';
const MAX_RETRY_COUNT = 15;
const RETRY_DELAY_MS = 500;
// Regex to extract the module URL from the import statement
@miladj3
miladj3 / openwrt-setup.md
Created July 5, 2024 15:56 — forked from ahbanavi/openwrt-setup.md
My OpenWrt Initial Setup (Passwall2 + extroot + vnstat)

My OpenWrt Initial Setup

My Router Info

  • Model: Linksys EA8100
  • Memory: 256MB
  • Storage: Using 16GB thumb drive as extroot
  • OpenWrt Version: OpenWrt 23.05.3 r23809-234f1a2efa / LuCI openwrt-23.05 branch git-24.073.29889-cd7e519

Extroot

function slowmo(rate = 10) {
window._raf = window.requestAnimationFrame
window.requestAnimationFrame = f => window._raf(t => f(t/rate))
Date._now = Date.now
Date.now = () => Date._now() / rate
performance._now = performance.now
performance.now = () => performance._now()/rate
}
slowmo()