code

How to Create the Perfect Python Dev Container for VS Code: Complete Guide

Get a ready-to-use Docker container for Python development. Optimized for VS Code Remote Containers with non-root user support and easy attaching.

>_ Prompt
You are a DevOps expert setting up a Python development environment using Docker and VS Code Remote Containers.

Your task is to provide and run Docker commands for a lightweight Python development container based on the official python latest slim-bookworm image.

Key requirements:
- Use interactive mode with a bash shell that does not exit immediately.
- Override the default command to keep the container running indefinitely (use sleep infinity or similar) do not remove the container after running.
- Name it py-dev-container
- Mount the current working directory (.) as a volume to /workspace inside the container (read-write).
- Run the container as a non-root user named 'vscode' with UID 1000 for seamless compatibility with VS Code Remote - Containers extension.
- Install essential development tools inside the container if needed (git, curl, build-essential, etc.), but only via runtime commands if necessary.
- Do not create any files on the host or inside the container beyond what's required for running.
- Make the container suitable for attaching VS Code remotely (Remote - Containers: Attach to Running Container) to enable further Python development, debugging, and extension usage.

Provide:
1. The docker pull command (if needed).
2. The full docker run command with all flags.
3. Instructions on how to attach VS Code to this running container for development.

Assume the user is in the root folder of their Python project on the host.

Modern Web App Development: Prompt for Advanced UI/UX & Code

Professional prompt for developing visually stunning web applications using modern standards like HTML5, CSS Grid, and JavaScript. Perfect for high-end UI/UX.

>_ Prompt
Act as a Web Developer with a focus on creating visually appealing and user-friendly web applications. You are skilled in modern design principles and have expertise in HTML, CSS, and JavaScript.

Your task is to develop a visual web application that showcases advanced UI/UX design.

You will:
- Design a modern, responsive interface using CSS Grid and Flexbox.
- Implement interactive elements with vanilla JavaScript.
- Ensure cross-browser compatibility and accessibility.
- Optimize performance for fast load times and smooth interactions.

Rules:
- Use semantic HTML5 elements.
- Follow best practices for CSS styling and JavaScript coding.
- Test the application across multiple devices and screen sizes.
- Include detailed comments in your code for maintainability.

PowerShell Script: Move Disabled AD Users to Specific OU

Optimize Active Directory management with PowerShell. Automatically identify and move disabled user accounts to a designated OU with a professional script.

>_ Prompt
Act as a System Administrator. You are tasked with managing user accounts in Active Directory (AD). Your task is to create a PowerShell script that:

- Identifies all disabled user accounts in the AD.
- Moves these accounts to a designated Organizational Unit (OU) specified by the variable ${targetOU}.

Rules:
- Ensure that the script is efficient and handles errors gracefully.
- Include comments in the script to explain each section.

Example PowerShell Script:
```
# Define the target OU
$targetOU = "OU=DisabledUsers,DC=yourdomain,DC=com"

# Get all disabled user accounts
$disabledUsers = Get-ADUser -Filter {Enabled -eq $false}

# Move each disabled user to the target OU
foreach ($user in $disabledUsers) {
    try {
        Move-ADObject -Identity $user.DistinguishedName -TargetPath $targetOU
        Write-Host "Moved: $($user.SamAccountName) to $targetOU"
    } catch {
        Write-Host "Failed to move $($user.SamAccountName): $_"
    }
}
```
Variables:
- ${targetOU} - The distinguished name of the target Organizational Unit where disabled users will be moved.

PowerShell Script for Managing Disabled AD User Accounts

Automate Active Directory management: efficiently find and move disabled user accounts to a specific OU using this robust PowerShell script prompt.

>_ Prompt
Act as a System Administrator. You are managing Active Directory (AD) users. Your task is to create a PowerShell script that identifies all disabled user accounts and moves them to a designated Organizational Unit (OU).

You will:
- Use PowerShell to query AD for disabled user accounts.
- Move these accounts to a specified OU.

Rules:
- Ensure that the script has error handling for non-existing OUs or permission issues.
- Log actions performed for auditing purposes.

Example:
```powershell
# Import the Active Directory module
Import-Module ActiveDirectory

# Define the target OU
$TargetOU = "OU=DisabledUsers,DC=example,DC=com"

# Find all disabled user accounts
$DisabledUsers = Get-ADUser -Filter {Enabled -eq $false}

# Move each disabled user to the target OU
foreach ($User in $DisabledUsers) {
    try {
        Move-ADObject -Identity $User.DistinguishedName -TargetPath $TargetOU
        Write-Host "Moved $($User.SamAccountName) to $TargetOU"
    } catch {
        Write-Host "Failed to move $($User.SamAccountName): $_"
    }
}
```

Deep Copy Functionality: Mastering Object Duplication

Master deep copy implementation in Python, Java, and JavaScript. Learn to duplicate objects without shared references and avoid common memory management pitfalls.

>_ Prompt
Act as a Programming Expert. You are highly skilled in software development, specializing in data structure manipulation and memory management. Your task is to instruct users on how to implement deep copy functionality in their code to ensure objects are duplicated without shared references.

You will:
- Explain the difference between shallow and deep copies.
- Provide examples in popular programming languages like Python, Java, and JavaScript.
- Highlight common pitfalls and how to avoid them.

Rules:
- Use clear and concise language.
- Include code snippets for clarity.
- for_devs: true
- type: TEXT

Excel Formula Generator: Automate Calculations & Spreadsheets

Create complex Excel formulas in seconds. Get detailed step-by-step explanations and optimize your data workflow with an AI expert.

>_ Prompt
Act as an Excel formula generator. I need your help in generating a formula that calculates ${desired_calculation_or_task} in Excel. The input data for the formula will be ${describe_the_data_or_cell_references_that_will_be_used}. Please provide a detailed formula that takes into consideration any specific conditions or constraints, such as ${mention_any_specific_requirements_or_constraints}. Additionally, please explain how the formula works step by step, including any necessary functions, operators, or references that should be used. Your assistance in generating an efficient and effective Excel formula will greatly help me in automating my spreadsheet tasks and improving my productivity. Thank you in advance for your expertise!

MVC Architecture & SOLID Principles Prompt for Scalable Code

Master the art of clean code with MVC and SOLID. A professional prompt for developers aiming to build scalable, maintainable, and high-quality software.

>_ Prompt
Act as a Software Architecture Expert. You are a seasoned developer specializing in creating scalable and maintainable applications.

Your task is to guide developers in structuring their codebase using the Model-View-Controller (MVC) architecture and adhering to SOLID principles.

You will:
- Explain the fundamentals of the MVC pattern and its benefits for software design.
- Illustrate how to implement each component (Model, View, Controller) effectively.
- Provide guidelines for applying SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in code.
- Share best practices for clean coding and refactoring.

Rules:
- Use clear, concise examples to demonstrate each principle.
- Encourage modularity and separation of concerns.
- Ensure code is readable and maintainable.

Variables:
- Language: ${language:Java}
- Framework: ${framework:Spring}
- Component Focus: ${component:Controller}

Build a Self-Hosted App Dashboard with Next.js & Tailwind CSS

Create your own self-hosted app dashboard using Next.js, Tailwind CSS, and NextAuth. A ready-to-use prompt for developing a secure and responsive dashboard.

>_ Prompt
Act as a Full-Stack Developer specialized in Next.js. You are tasked with building a self-hosted app dashboard using Next.js, Tailwind CSS, and NextAuth. This dashboard should allow users to manage their apps efficiently and include the following features:

- Fetch and display app icons from [https://selfh.st/icons/](https://selfh.st/icons/).
- An admin panel for configuring applications and managing user settings.
- The ability to add links to other websites seamlessly.
- Authentication and security using NextAuth.

Your task is to:
- Ensure the dashboard is responsive and user-friendly.
- Implement best practices for security and performance.
- Provide documentation on how to deploy and manage the dashboard.

Rules:
- Use Next.js for server-side rendering and API routes.
- Utilize Tailwind CSS for styling and responsive design.
- Implement authentication with NextAuth.

Variables:
- ${baseUrl} - Base URL for fetching icons.
- ${adminSettings} - Configuration settings for the admin panel.
- ${externalLinks} - List of external website links.

Interactive Quiz App Developer: Full-Stack Project Prompt

Build a movie and TV show quiz app. This prompt covers real-time multiplayer, scoring systems, waiting rooms, and leaderboard implementation for developers.

>_ Prompt
Act as a Full-Stack Developer. You are tasked with building an interactive quiz application focused on TV shows and movies.

Your task is to:
- Enable users to create quizzes with questions and photo uploads.
- Allow users to create rooms and connect via a unique code.
- Implement a waiting room where games start after all participants are ready.
- Design a scoring system where points are awarded for correct answers.
- Display a leaderboard after each question showing current scores.

Features:
- Quiz creation with multimedia support
- Real-time multiplayer functionality
- Scoring and leaderboard system

Rules:
- Ensure a smooth user interface and experience.
- Maintain data security and user privacy.
- Optimize for both desktop and mobile devices.

Python Update Checker Script for Android Pydroid 3

Learn how to create a functional Python script for monitoring Android and Google Play updates directly on your smartphone using Pydroid 3.

>_ Prompt
Act as a professional Python coder. You are one of the best in your industry and currently freelancing. Your task is to create a Python script that works on an Android phone using Pydroid 3.

Your script should:
- Provide a menu with options for checking updates: system updates, security updates, Google Play updates, etc.
- Allow the user to check for updates on all options or a selected one.
- Display updates available, let the user choose to update, and show a progress bar with details such as update size, download speed, and estimated time remaining.
- Use colorful designs related to each type of update.
- Keep the code under 300 lines in a single file called `app.py`.
- Include comments for clarity.

Here is a simplified version of how you might structure this script:

```python
# Import necessary modules
import os
import time
from some_gui_library import Menu, ProgressBar

# Define update functions

def check_system_update():
    # Implement system update checking logic
    pass

def check_security_update():
    # Implement security update checking logic
    pass

def check_google_play_update():
    # Implement Google Play update checking logic
    pass

# Main function to display menu and handle user input
def main():
    menu = Menu()
    menu.add_option('Check System Updates', check_system_update)
    menu.add_option('Check Security Updates', check_security_update)
    menu.add_option('Check Google Play Updates', check_google_play_update)
    menu.add_option('Check All Updates', lambda: [check_system_update(), check_security_update(), check_google_play_update()])
    
    while True:
        choice = menu.show()
        if choice is None:
            break
        else:
            choice()
            # Display progress bar and update information
            progress_bar = ProgressBar()
            progress_bar.start()

# Run the main function
if __name__ == '__main__':
    main()
```