Skip to content

Instantly share code, notes, and snippets.

View mortezasabihi's full-sized avatar
💻
Working From Home

Morteza Sabihi mortezasabihi

💻
Working From Home
View GitHub Profile
@mhrlife
mhrlife / my_personal_agent_prompt.md
Created September 1, 2025 05:00
A system prompt for an AI assistant specialized in computer engineering. Provides PhD-level technical answers with citations, featuring a two-part response format: concise answer + storytelling explanation with formal definitions. Optimized for ADHD-friendly reading. (I use it with Opus 4.1)

You are a personal agent for me. You find answers to computer engineering questions. I am a senior-level programmer with advanced education. You don't give naive or simple answers. Your answers are PhD-level, backed by sources, without any assumptions or guesses.

Speaking Style

Your answer must be in two parts:

  1. Concise Answer: Low verbosity, to-the-point, ADHD-friendly response
  2. Detailed Explanation: Medium verbosity, ADHD-friendly narrative that explains the concept through storytelling.
@mberneti
mberneti / retryDynamicImport.ts
Last active September 13, 2025 07:53
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
@jengel3
jengel3 / authentication-1.controller.ts
Last active April 23, 2024 19:26
NestJS - Implementing Access & Refresh Token Authentication
// app/modules/authentication/authentication.controller.ts
import { Body, Controller, Post } from '@nestjs/common'
import { RegisterRequest } from './requests'
import { User } from '../../modules/user'
import { UsersService } from '../users/users.service'
@wiegertschouten
wiegertschouten / grid.scss
Created October 1, 2020 18:38
A very simple grid system built with SASS and CSS grid
$columns: 12;
$gap: 30px;
$breakpoints: (
xs: 480px,
sm: 768px,
md: 960px,
lg: 1170px,
xl: 1280px
);
@kstevenson722
kstevenson722 / Mount USB Drive for Proxmox Backup.md
Last active July 18, 2025 10:38
Mount UBS Drive for Proxmox Backup
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active March 11, 2025 16:59
SSH Tunnel as systemd service

${LOCAL_ADDR IP:PORT}

یعنی سرور ایرانتون و پورت داخلی که میخواهید روش ساکس داشته باشید و باید با این جایگزین بشود.

مثال:

10.10.10.10:9090

و قسمت پایین هم یوزر سرور خارجتون و آدرس IP سرور خارجیتونه که باید جایگزین کنید تو خط 7 فایل ssh-tunnel-as-systemd.sh

@TimVosch
TimVosch / app.controller.ts
Last active February 22, 2024 05:00
Get request parameters in FileInterceptor
import { Controller, UseInterceptors, Post } from '@nestjs/common';
import { AppService } from './app.service';
import { diskStorage } from 'multer';
import { Request } from 'express';
import { MyNewFileInterceptor } from './file.interceptor';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@lewebsimple
lewebsimple / nuxtjs-nestjs.md
Last active January 19, 2024 16:14
NuxtJS / NestJS fullstack development

This is my take on fullstack development using NuxtJS and NestJS.

Development steps

  • Lerna monorepo
  • TypeScript linting and formatting
  • Minimal NestJS server
  • Minimal NuxtJS client
  • Environment configuration
  • TypeGraphQL
  • TypeORM / MySQL
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active September 25, 2025 08:29
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@evvvritt
evvvritt / package.json
Last active December 20, 2019 15:52
Simple purgecss implementation for Vue CLI 3
// using in a Vue CLI 3, tailwindcss app but can be adjusted
"scripts": {
"build": "vue-cli-service build",
"postbuild": "yarn purgecss",
"purgecss": "node_modules/purgecss/bin/purgecss --config ./purgecss.config.js --out ./dist/css"
},