Skip to content

Instantly share code, notes, and snippets.

View MostafaRastegar's full-sized avatar

Mostafa Rastegar MostafaRastegar

  • Iran
View GitHub Profile
import { CacheFirst, ExpirationPlugin, NetworkOnly, Serwist } from "serwist";
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist";
declare global {
interface WorkerGlobalScope extends SerwistGlobalConfig {
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
}
}
declare const self: ServiceWorkerGlobalScope;
@MostafaRastegar
MostafaRastegar / free-ai-developer
Created October 12, 2025 07:05
free-ai-developer
عالی 👌
بیایید یک **AI-driven pipeline** برای پروژه‌ی fullstackت طراحی کنیم (Python + Next.js + TypeScript + Docker)،
که هدفش اینه:
📍 از مرحله‌ی ایده و برنامه‌ریزی تا تولید و استقرار، مدل‌های هوش مصنوعی مختلفت به‌صورت مرحله‌به‌مرحله با هم همکاری کنند.
---
## 🧩 **AI Fullstack Development Pipeline (Planning → Coding → Deployment)**
### **Phase 1 — Planning & System Design**
@MostafaRastegar
MostafaRastegar / cline_rules.md
Created October 11, 2025 09:28
cline_rules.md

Token Optimization Rules

PRIMARY DIRECTIVE

Minimize token consumption while maintaining high-quality output. Never sacrifice functionality, security, or code quality for token reduction.

PARSING USER REQUESTS

Extract Core Intent

  • Identify the exact action required (create, modify, delete, debug, refactor)
  • Determine specific targets (files, functions, lines, components)
#!/bin/sh
LOC='/etc/resolvconf/resolv.conf.d/head'
function shecan {
if [[ $1 = 'remove' ]]; then
echo | sudo tee $LOC
else
echo 'nameserver 10.202.10.202' | sudo tee $LOC
echo 'nameserver 10.202.10.102' | sudo tee -a $LOC
fi
sudo resolvconf -u
@MostafaRastegar
MostafaRastegar / ubuntu-after-install-for-developers
Last active July 9, 2024 21:34
config ubuntu after install for developer
sudo apt-get update
sudo apt install git
sudo apt install curl
sudo apt-get install zsh
which zsh
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
in bashrc -> exec zsh
@MostafaRastegar
MostafaRastegar / myscript.sh
Created October 28, 2021 04:03 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@MostafaRastegar
MostafaRastegar / vscode-settings.json
Last active March 7, 2023 03:43
Custom vsCode settings for reactjs developers
{
"workbench.startupEditor": "newUntitledFile",
"git.autofetch": true,
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.colorTheme": "Night Owl",
"[javascript]": {
@MostafaRastegar
MostafaRastegar / index.html
Created February 4, 2020 20:09
javascript infinit array
<!DOCTYPE html>
<html>
<body>
<ul id="myList1">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<div class="main">
<div class="bird relative bRadius flex">
<div class="bird__eye_big bgWhite bRadius flex relative mTopAuto">
<div class="bird__eye_small bRadius relative flex mLeftAuto">
<span class="bird__eye_small-one bRadius relative bgWhite"></span>
<span class="bird__eye_small-two right bRadius relative bgWhite"></span>
</div>
</div>
<div class="bird__eye_big bgWhite bRadius flex relative mTopAuto">
<div class="bird__eye_small bRadius relative flex mRightAuto right small2">