Skip to content

Instantly share code, notes, and snippets.

View sadegh19b's full-sized avatar
🏠
Working from home

Sadegh Barzegar sadegh19b

🏠
Working from home
View GitHub Profile
@sadegh19b
sadegh19b / BypassTelegramByCloudflare.md
Last active April 19, 2025 12:00
How to Use Cloudflare Workers to Bypass Telegram

To create a Cloudflare Worker that acts as a bidirectional proxy between your domain and Telegram, follow these steps:

Step 1: Create the Cloudflare Worker Script

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
@sadegh19b
sadegh19b / map.html
Created February 16, 2025 12:11
Leaflet Map With Centeral Marker
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<style>
#map {
z-index: 1;
height: 400px;
}
.map-container {
position: relative;
@sadegh19b
sadegh19b / cursor_reset.py
Last active March 10, 2025 02:11
Cursor Trial Reset Tool
import os
import sys
import json
import uuid
import hashlib
import shutil
import sqlite3
import logging
from colorama import Fore, Style, init
@sadegh19b
sadegh19b / HasOptions.php
Last active March 28, 2025 05:28
Enum Helpers
<?php
declare(strict_types=1);
namespace App\Support\Enums\Concerns;
trait HasOptions
{
/**
* Get an associative array with enum values as keys and labels as values.
@sadegh19b
sadegh19b / SearchFilter.php
Created October 12, 2024 11:39
Filament Search Filter
<?php
namespace App\Filament\Filters;
use Filament\Forms;
use Filament\Tables\Filters\BaseFilter;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Str;
@sadegh19b
sadegh19b / ResourceLabelsTranslation.php
Created October 7, 2024 15:09
Filament Resource Labels Translation
<?php
namespace App\Filament\Concerns;
use Lang;
trait ResourceLabelsTranslation
{
public static function getModelLabel(): string
{
@sadegh19b
sadegh19b / InteractsWithValidation.php
Last active November 4, 2022 22:24
Laravel InteractsWithValidation Trait for use in Testing
<?php
namespace Tests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
trait InteractsWithValidation
{
@sadegh19b
sadegh19b / git-contribution-guide.md
Last active September 15, 2022 04:39
Git Contribution Guide

Branches

  • At first create a master branch for yourself with your name like ali/master
  • Keep your branch names short, easy to read, and meaningful. Other developers should be able to understand a branch's contents by reading its name.
  • Specify a scope for your branch, a branch should not introduce 5 features and fixes 4 bugs at the same time
  • Keep your branch updated, merge master into your master branch from time to time. An updated branch is easier to review and far more easier to merge.
  • Make sure that your desired branch name does not have conflict with any remote branches.