Skip to content

Instantly share code, notes, and snippets.

View mobinjavari's full-sized avatar

Mobin Javari mobinjavari

View GitHub Profile
@mobinjavari
mobinjavari / telegram-bot-api.md
Created August 14, 2025 13:51
Telegram Bot API Manager - Install, Update, and Run

Telegram Bot API Manager

This project provides a Bash script to install, update, and run the Telegram Bot API on Linux systems. The script automatically detects your system's package manager and installs the required dependencies.


📦 Supported Package Managers

  • dnf → Fedora, RHEL, CentOS 8+
@mobinjavari
mobinjavari / git-commands.md
Created August 14, 2025 13:13
Git Commands Cheat Sheet

Git Commands Cheat Sheet

Note

Quick reference for the most commonly used Git commands
Perfect for beginners and pros who want a clean, fast reminder.


1. Setup

@mobinjavari
mobinjavari / TelegramBot.php
Last active July 27, 2025 21:10
Telegram Update API Bot
<?php
// Read and decode incoming JSON from Telegram
$input = file_get_contents('php://input');
$update = json_decode($input, true);
// Reject if not a valid update
if (!is_array($update)) {
http_response_code(403);
exit;
@mobinjavari
mobinjavari / fonts.json
Created July 24, 2025 16:57
The best programming fonts
[
"CascadiaCode",
"JetBrainsMono",
"FiraCode",
"CourierPrimeCode",
"ChalkboardSE",
"WParvaz",
"VazirFont",
]
@mobinjavari
mobinjavari / ollama.py
Created July 24, 2025 16:52
Tiny AI (Ollama)
from flask import Flask, request, jsonify
import requests
app = Flask(__name__)
@app.route('/', methods=['GET'])
def generate():
data = {
"model": "phi3:mini",
"messages": [
@mobinjavari
mobinjavari / smart.pac
Created July 23, 2025 22:16
Smart PAC File for Selective Proxy Routing
function FindProxyForURL(url, host) {
// ==== Proxy Configuration ====
var PROXY = "PROXY 127.0.0.1:10808"; // Local proxy
var DIRECT = "DIRECT"; // No proxy, connect directly
var DEFAULT = PROXY; // Fallback behavior
// ==== Domain Rules ====
// Domains to bypass proxy (always direct)
var directDomains = [
@mobinjavari
mobinjavari / MacOS.md
Last active July 23, 2025 22:38
MacOS Useful commands

MacOS Useful commands

How to fix the error can't be opened because Apple cannot check it for malicious software?

  • This error indicates that "Apple cannot determine whether this file contains a virus and therefore will not run the file."
sudo xattr -rd com.apple.quarantine /path/to/file

How to setup remote login (SSH, FTP,...)

  • Enable
@mobinjavari
mobinjavari / cPmove.sh
Last active March 18, 2025 00:44
WHM cPmove
#!/bin/bash
# Variables
USERNAME="your_username"
DESTINATION_SERVER="destination_server_ip"
DESTINATION_PATH="/home/"
BACKUP_FILE="/home/cpmove-$USERNAME.tar.gz"
echo "[+] Creating backup for $USERNAME..."
/scripts/pkgacct $USERNAME

REGEX

Regex (short for Regular Expressions) is a powerful tool for searching and processing text. Using Regex, you can define patterns to match text and use them to extract, replace, or analyze data.
  • Advanced Search: Find specific words or patterns in text.
  • Input validation: Checking the format of email, phone number, zip code, etc.
  • Data extraction: Extracting specific data from text.
  • Text replacement: Changing specific words or patterns.

1. Regex structure

1.1 Basic characters

MARKDOWN

Markdown is a simple, lightweight text formatting language that is primarily used for writing documentation, README files, blogs, and content that will be rendered as HTML. Markdown allows you to structure your text using simple markup.

Advantages:

  • Simple and readable: No need to learn complex tags.
  • Wide compatibility: Support across many editors, blogging systems, and software development tools.
  • Convertable: Easily converts to HTML, PDF, and other formats.