Skip to content

Instantly share code, notes, and snippets.

View tanvirraj's full-sized avatar
🚢
coding

Tanvir Raj tanvirraj

🚢
coding
View GitHub Profile
@tanvirraj
tanvirraj / prd_tod.txt
Created June 16, 2025 07:52 — forked from Dowwie/prd_tod.txt
Product requirement document generation using LLM task oriented dialogue
This is an LLM-assisted workflow for creating a product requirement document using LLM assistance for task completion.
It keeps track of inputs for the template and works with the user to acquire them, finally generating a completed PRD
prompt when all slots are addressed.
credit: Ian Nuttall - https://gist.github.com/iannuttall/f3d425ad5610923a32397a687758ebf2
**System-Prompt for Facilitating Chat-Based PRD Creation**
@tanvirraj
tanvirraj / socratic_fp_learning.md
Created June 16, 2025 06:50 — forked from Dowwie/socratic_fp_learning.md
Following is a prompt for effective learning with an LLM. It uses the Socratic method to help the student build up their understanding from first principles. Replace the topic in the prompt and then in your follow-up prompt , specify the subject.

You are a teacher of algorithms and data-structures who specializes in the use of the socratic method of teaching concepts. You build up a foundation of understanding with your student as they advance using first principles thinking. Explain the subject that the student provides to you using this approach. By default, do not explain using source code nor artifacts until the student asks for you to do so. Furthermore, do not use analysis tools. Instead, explain concepts in natural language. You are to assume the role of teacher where the teacher asks a leading question to the student. The student thinks and responds. Engage misunderstanding until the student has sufficiently demonstrated that they've corrected their thinking. Continue until the core material of a subject is completely covered. I would benefit most from an explanation style in which you frequently pause to confirm, via asking me test questions, that I've understood your explanations so far. Particularly helpful are test questions related to sim

---
description:
globs:
alwaysApply: true
---
At the end of each task, you need to write all changes to ARCHITECTURE.md.
And by write all changes, I mean modify the architecture of the entire app. If you've changed a function - modify its params/output or whatever you changed.
If you've added a new file - add it to the ARCHITECTURE.md.
@pytest.mark.parametrize(
"billing_type, wants_premium, expected_status, expected_premium",
[
(Account.BillingType.V1, True, 400, False),
(Account.BillingType.GIFT, True, 200, True),
],
)
def test_update_account_wanting_premium(
url,
client,
@tanvirraj
tanvirraj / compress_video
Created August 23, 2024 06:55 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
app-web |
app-web | ====
app-web | Contents of self.request:
app-web | _request: <WSGIRequest: POST '/api/emails/register/'>
app-web | parsers: [<rest_framework.parsers.JSONParser object at 0x10e497ad0>, <rest_framework.parsers.FormParser object at 0x10e494a70>, <rest_framework.parsers.MultiPartParser object at 0x10e4947d0>]
app-web | authenticators: [<rest_framework.authentication.SessionAuthentication object at 0x10e4975f0>, <rest_framework.authentication.BasicAuthentication object at 0x10e4941d0>]
app-web | negotiator: <rest_framework.negotiation.DefaultContentNegotiation object at 0x10e497650>
app-web | parser_context: {'view': <emails.views.rest.auth.RegistrationUserViewSet object at 0x10e496780>, 'args': (), 'kwargs': {}, 'request': <rest_framework.request.Request: POST '/api/emails/register/'>, 'encoding': 'utf-8'}
app-web | _data: {'username': 'raqib', 'password': 'raqib!@#password', 'email': '[email protected]'}
@tanvirraj
tanvirraj / mathpix2gpt.py
Created June 13, 2023 07:04 — forked from danielgross/mathpix2gpt.py
mathpix2gpt.py
import requests
import time
import os
import sys
import openai
import tiktoken
from termcolor import colored
openai.api_key = open(os.path.expanduser('~/.openai')).read().strip()
package main
import (
"fmt"
"math/rand"
"net/http"
"github.com/gin-gonic/gin"
"gorm.io/driver/sqlite"
"gorm.io/gorm"

DDD is a way to build computer programs that helps make them easier to understand and use. It's like building with blocks: you start with small, simple blocks and put them together to make bigger, more complex structures.

In DDD, we use something called "domains" to organize our blocks. A domain is like a group of blocks that all have something in common. For example, if we were building a program about pets, we might have a domain for dogs, a domain for cats, and a domain for birds.

Inside each domain, we use something called "entities" to represent the things in our program. An entity is like a specific block that has its own unique properties. For example, in the dog domain, we might have an entity for a specific dog with properties like its name, breed, and age.

We also use "value objects" to represent things that don't have a unique identity, but are still important. For example, in the dog domain, we might have a value object for a dog's collar, which would have properties like its color and size.

F

@tanvirraj
tanvirraj / dependencyInjection.md
Created March 17, 2023 13:26
dependency injection typescript example with classes this file is generated by chatGPT

First, create an interface for the dependency you want to inject, for example:

interface Logger {
  log(message: string): void;
}

Next, create a class that implements the interface: