Coding
814 prompts available
Admin Social Media Site
Create a fully functional social media website that includes protected login and sign-up pages accessible only by the admin. The website should enable standard social media features such as user profiles, posts, comments, and interactions, but restrict access to the login and sign-up functionality exclusively to the admin users. Ensure secure authentication mechanisms, proper session management, and user data protection throughout the site. # Requirements - Implement admin-only access for the login and sign-up pages. - Include typical social media features: user profiles, posting content, commenting, and user interactions. - Ensure secure and robust authentication and authorization. - Protect user data with best security practices. - Provide clear error handling and user feedback. # Steps 1. Design the database schema to accommodate users, posts, comments, and admin status. 2. Create backend APIs for user management, posts, and interactions with authentication checks. 3. Develop the frontend with pages for user profiles, posts, comments, and other social features. 4. Implement secure authentication with password hashing and session or token management. 5. Restrict access to login and sign-up pages so only admin users can use them. 6. Test all features thoroughly, ensuring security and proper access control. # Output Format Provide the complete source code including frontend and backend files, and any necessary configuration files or instructions for deployment.
Admin User Management Setup
You are a professional programmer tasked with developing a user management system for a web server project using the following specifications: 1. **User Registration:** Implement a one-sided registration system performed exclusively via the console (no UI registration). 2. **Login:** Create a login system accessible through a web page. 3. **Session Persistence:** Implement cookie-based user session storage that keeps the user logged in for 24 hours only if the "remember me" checkbox is selected during login. 4. **Admin Page:** Develop and integrate the admin dashboard using an existing template which you can extend further. **Technical Stack and Tools:** - Backend framework: Express.js - Database: MongoDB using Mongoose ODM - Template Engine for front end: EJS - Password hashing: bcrypt - Session/Cookie Management: Recommend and implement the most suitable package (e.g., express-session vs jsonwebtoken), with a focus on security and ease of use. **Existing Project Information:** - Files available: server.js, errorHandle.js, project folder structure, and .env configuration (including environment variables). - No current middleware for authentication or authorization. **User Schema Requirements:** - Fields: username, email, hashed password, role (only "admin" role exists), timestamps. - No role-based access control beyond "admin". **Frontend:** - Admin panel template is ready to be integrated (or needs to be created). - CSS Framework: Bootstrap - Responsive design is required. **Security:** - Rate limiting to 5 login attempts to prevent brute force attacks. **Task Instructions:** - Specify all resources, files, or information you need to begin development. - Include detailed steps and recommendations to implement the system considering scalability and maintainability. - Provide clear reasoning behind technology choices, especially for session management. # Steps 1. Review the existing code and folder structure. 2. Define the user schema with Mongoose including necessary validations. 3. Implement console-based registration script. 4. Develop login functionality with Express.js and EJS, including "remember me" cookie logic. 5. Setup session or token management with selected libraries. 6. Implement login attempt rate limiting. 7. Integrate admin template and ensure responsiveness with Bootstrap. 8. Secure all routes, especially administrative ones. # Output Format Provide a detailed implementation plan that includes: - The exact list of resources/files you require. - A step-by-step development plan. - Suggested code snippets or pseudocode for critical parts. - Justifications for technology and design decisions. - Any additional notes on security, scalability, or user experience. # Notes - Consider best practices for password hashing and cookie security. - Suggest improvements where applicable, such as adding middleware. - Keep explanations clear and professional to guide the implementation thoroughly. Your response must be comprehensive and structured to enable smooth development of the described user management system.
Adobe Sign Laravel 8 Integration
Provide a detailed, step-by-step guide on how to integrate Adobe Sign with a Laravel 8 application. The guide should include: - Setting up Adobe Sign API credentials. - Installing and configuring any necessary Laravel packages or SDKs. - Authentication with Adobe Sign API. - Creating and sending agreements/documents for signature from within Laravel. - Handling callbacks or webhooks from Adobe Sign to update document status in Laravel. - Storing and accessing signed documents in the Laravel application. Explain any required configurations, code examples (including Laravel-specific syntax), and best practices. Include sample code snippets demonstrating how to initiate a signature request, handle responses, and update your application's database accordingly. # Steps 1. Register and obtain Adobe Sign API credentials. 2. Set up Laravel project and install necessary packages. 3. Configure environment variables for Adobe Sign credentials. 4. Implement authentication with Adobe Sign API. 5. Write code to create and send signature requests. 6. Handle Adobe Sign callbacks/webhooks. 7. Store signed documents securely. # Output Format Provide the guide in clear, numbered steps with code examples formatted in markdown. Include explanations for each step to ensure clarity for developers familiar with Laravel 8. # Notes - Assume the user has basic knowledge of Laravel. - Focus on integration specifics with Adobe Sign. - Mention any important security considerations such as API key storage and webhook verification.
Adopt Me! Furniture Scanner Script
Create a script for the game "Adopt Me!" that scans furniture in a player's house, retrieves detailed information about each furniture item, and prepares the data for storage. The script should include functionality to connect to a specified API using API developer and user keys. Additionally, the scanned furniture data should be formatted for pasting into a service like Pastebin. Ensure the script can handle different furniture attributes such as scale, color, and positioning.
Adopt Me Pet Spawner
Write a complete, well-commented script for the "Adopt Me" game that enables spawning any pet from a comprehensive, accurate list of valid pet names. The script must: - Maintain a predefined, up-to-date list of correctly spelled pet names. - Accept pet name input from the user. - Validate the input against the list, considering case sensitivity as appropriate. - If the pet name is found, spawn the pet in-game. - If the pet name is invalid, provide a clear, user-friendly message explaining the error and prompt for re-entry or suggest possible corrections. - Include clear instructions within the script or as comments on how to use it. - Ensure compatibility with Adopt Me's scripting environment. - Structure the code clearly so it is easy to read, understand, and modify. Steps to accomplish the task: 1. Define a collection (list, array, or dictionary) that contains all valid pet names spelled correctly. 2. Implement a function or method to capture user input for the pet name. 3. Validate this input against the valid pet names list. 4. If valid, call the game's spawn function or command to spawn that pet. 5. If invalid, display an informative message and prompt the user to try again, optionally suggesting the closest valid pet names. Output Format: - Complete script code suitable for use in the Adopt Me game environment. - All code sections must be commented to explain their purpose. - Usage instructions embedded clearly at the top or as separate comments. Example placeholder for valid pet names: -- validPets = { "Cat", "Dog", "Dragon", "Unicorn", ... } Example snippet for validation: if validPets[inputPetName] then spawnPet(inputPetName) else print("Pet name invalid. Please check the spelling and try again.") end Notes: - Ensure the script handles case differences appropriately (e.g., "dragon" vs "Dragon"). - The script should never cause the game to error out due to invalid input. - Consider usability and user experience in feedback messages. - Assume you have access to Adopt Me's standard API or functions to spawn pets. This prompt is intended to produce a robust, user-friendly pet spawning script that integrates seamlessly with Adopt Me, prevents invalid input errors, and offers guidance to users on correct pet name usage.
Adopt Me Pet Spawner Script
You are tasked with creating a Lua script for the Adopt Me game that allows users to spawn any valid pet from a predefined list of pet names. The script should: - Maintain and use a list of valid pet names. - Accept user input for the pet name in a case-insensitive manner. - Validate the input against the pet list. - If valid, spawn the pet using the Adopt Me pet spawning API. - If invalid, provide clear feedback and suggest closest matching pet names based on string similarity (e.g., Levenshtein distance). - Continuously prompt the user until a valid pet name is provided and the pet is spawned. Your script must include helper functions to handle case insensitivity and compute string distances for suggestions. The user interaction should handle empty input gracefully. Use comments within the script to indicate areas for the Adopt Me API calls that perform pet spawning and input reading, recognizing that input/output methods may vary in the Adopt Me scripting environment. # Steps 1. Define a list of valid pet names for spawning. 2. Create a lookup table with lowercase keys for efficient validation. 3. Implement a helper function to convert strings to lowercase. 4. Implement a Levenshtein distance function to measure string similarity. 5. Implement a function to suggest pet names close to the invalid input based on the Levenshtein distance. 6. Implement a function to spawn pets via the Adopt Me API (using a placeholder function call). 7. Implement the main interaction loop: - Prompt the user to enter the name of a pet. - If input is empty, notify the user and prompt again. - If the input matches a valid pet name (case-insensitive), spawn the pet and exit. - If invalid, display an error message and suggest close matches. - Repeat until successful. # Output Format Provide a fully functional and well-commented Lua script implementing the above requirements. The script should be syntactically correct and ready to be adapted to the Adopt Me environment by replacing placeholder comments with actual API calls as needed. # Notes - Ensure string comparisons are case-insensitive. - Suggestions should be limited to pet names within a Levenshtein distance threshold (e.g., 2). - Clearly document placeholder areas where Adopt Me's actual pet spawning API calls and input methods should be inserted. # Response Formats ## prompt {"prompt":"[Complete Lua script as specified]",
Adopt Me Pet Trade Script
Create a detailed and easy-to-understand script for the game "Adopt Me" that allows a player to trade pets with other players and spawn pets. The script should include clear instructions or code snippets showing how to initiate a trade, accept or decline trade offers, specify which pets are being traded, and how to spawn new pets into the game environment. Ensure the script complies with typical game scripting standards and is safe to use without violating game rules or causing unintended side effects. Be sure to explain any required permissions or prerequisites for the script to function correctly. Use comments in the code for clarity and include reasoning for each step or function included. # Steps - Outline the approach to handle pet trading mechanics. - Provide code or pseudocode for initiating and managing trades. - Include methods for spawning pets, specifying pet types and quantities. - Comment the script thoroughly to explain how each part works. - Provide any usage examples or test cases. # Output Format Provide the complete script in a properly formatted code block, using the appropriate scripting language syntax (e.g., Lua if applicable for "Adopt Me") accompanied by detailed inline comments and a brief explanation section following the code that summarizes how the script works and its features. # Notes The script must avoid exploiting or disrupting game mechanics unfairly. Emphasize ethical scripting practices and adherence to game policies.
AdoptMe Pet Spawner
Write a complete, well-commented script compatible with the Adopt Me game environment that allows spawning any pet from a comprehensive and accurate list of valid pet names. The script must: - Have a predefined list of all valid pet names, correctly spelled and maintained up-to-date. - Accept pet name input from the user. - Validate user input against the valid pet name list, handling case insensitivity in a user-friendly way. - Spawn the pet in-game if the input is valid using Adopt Me's standard spawning functions. - Provide clear, user-friendly error messages if the pet name is invalid, including helpful guidance or suggestions. - Include embedded comments explaining how the script works and how to use it. - Be structured clearly for readability and easy maintenance. - Ensure robust error handling so that invalid inputs never cause game errors. # Steps 1. Define a Lua table containing all valid pet names as keys, their standardized casing as values. 2. Create a function to read user input for the pet name. 3. Implement a validation function that normalizes user input, matches it against the valid pets list regardless of case. 4. If the pet name is valid, call Adopt Me's pet spawning API to spawn the pet. 5. If invalid, present a clear message prompting the user to retry or offering suggestions for similar pet names. # Output Format Provide a complete Adopt Me Lua script, fully commented: - Begin with usage instructions as comments. - Clearly comment each code block describing its purpose. - Use idiomatic Lua consistent with Adopt Me scripting practices. - Include graceful error handling and user feedback. # Notes - Handle case differences by normalizing inputs internally but preserve proper pet name casing for display and spawning. - Use string similarity or simple heuristics for suggesting closest valid pet names when input is invalid. - Assume access to standard Adopt Me environment APIs for spawning pets and printing messages.
AdoptMePetSpawner
-- Lua script for Adopt Me game to spawn pets from a predefined list -- Define the list of valid pet names local validPets = { "Dog", "Cat", "Dragon", "Turtle", "Parrot", "Frog", "Rabbit", "Lion", "Elephant", "Cheetah" } -- Create a lookup table with lowercase keys for efficient validation local petLookup = {} for _, pet in ipairs(validPets) do petLookup[pet:lower()] = pet end -- Helper function to convert string to lowercase local function toLower(str) return string.lower(str) end -- Compute Levenshtein distance between two strings local function levenshtein(str1, str2) local len1 = #str1 local len2 = #str2 local matrix = {} -- Initialize matrix for i = 0, len1 do matrix[i] = {} matrix[i][0] = i end for j = 0, len2 do matrix[0][j] = j end for i = 1, len1 do for j = 1, len2 do local cost = (str1:sub(i, i) == str2:sub(j, j)) and 0 or 1 matrix[i][j] = math.min( matrix[i-1][j] + 1, -- deletion matrix[i][j-1] + 1, -- insertion matrix[i-1][j-1] + cost -- substitution ) end end return matrix[len1][len2] end -- Suggest closest matching pet names based on Levenshtein distance threshold local function suggestPets(input, threshold) local suggestions = {} input = toLower(input) for petLower, petOriginal in pairs(petLookup) do local dist = levenshtein(input, petLower) if dist <= threshold then table.insert(suggestions, petOriginal) end end return suggestions end -- Function to spawn pet using Adopt Me API - placeholder local function spawnPet(petName) -- TODO: Replace this placeholder with actual Adopt Me pet spawning API call -- Example: AdoptMeAPI.spawnPet(petName) print("Spawning pet: " .. petName) -- Placeholder print statement end -- Function to get user input - placeholder local function getUserInput(promptMessage) -- TODO: Replace this placeholder with actual input reading method in Adopt Me environment io.write(promptMessage) local input = io.read() return input end -- Main interaction loop while true do local inputPet = getUserInput("Enter the name of the pet you want to spawn: ") if inputPet == nil or inputPet:match("^%s*$") then print("Input cannot be empty. Please enter a pet name.") else local inputLower = toLower(inputPet) local validPetName = petLookup[inputLower] if validPetName then spawnPet(validPetName) break -- Exit loop after successful spawn else print("Invalid pet name: '" .. inputPet .. "'.") local suggestions = suggestPets(inputPet, 2) -- Levenshtein distance threshold = 2 if #suggestions > 0 then print("Did you mean one of these?") for _, sug in ipairs(suggestions) do print(" - " .. sug) end else print("No similar pet names found.") end end end end
ADS Cooldown for Speed Boost
Create a cooldown mechanism for aiming down sights (ADS) in a game to prevent speed boosting exploits. Details: - Implement a cooldown period that activates whenever a player aims down sights. - During the cooldown, prevent the player from moving faster than intended, effectively disabling speed boosts gained by toggling ADS rapidly. - Ensure the cooldown duration balances gameplay fairness without frustrating legitimate player actions. - Consider edge cases such as switching weapons or rapidly toggling ADS. - Provide clear reasoning steps and considerations before presenting the solution. # Steps 1. Define the problem of speed boosting when toggling ADS. 2. Determine an appropriate cooldown duration based on typical gameplay. 3. Implement logic to track the cooldown timer whenever ADS is activated. 4. Restrict player movement speed if within the cooldown period. 5. Test against rapid toggling and weapon switching scenarios. 6. Fine-tune parameters to maintain gameplay flow. # Output Format Provide a detailed explanation of the cooldown mechanism along with example pseudocode or code snippets (in the relevant game scripting language) implementing the cooldown logic. # Notes Consider how the cooldown might affect player experience and suggest ways to visually or audibly indicate the cooldown status if applicable.
Adsense Revenue Calculator
Develop a complete responsive Adsense Revenue Calculator Tool that includes the following features: input fields for estimated page views and click-through rate (CTR), and displays the calculated revenue based on CPC (Cost Per Click). Ensure the tool has colorful styling, utilizing any free libraries as necessary for enhanced functionality and design. The tool should be implemented using HTML, CSS for styling, and JavaScript for the calculation logic. ## Steps 1. **HTML Structure**: Create the layout with input fields for: - Estimated Page Views - Click Through Rate (CTR) - Cost Per Click (CPC) - A button to calculate revenue. - Display area for the calculated revenue. 2. **CSS Styling**: Use CSS to style the tool, ensuring it’s visually appealing and responsive. Consider using a CSS library like Bootstrap for grid and responsive design. 3. **JavaScript Logic**: - Capture input values when the calculate button is clicked. - Implement the formula to calculate revenue: `Revenue = (Page Views * CTR * CPC)/100`. - Display the calculated revenue. ## Output Format The output should consist of the following files: - An `index.html` file containing the markup. - A `styles.css` file for styling can be linked in the HTML file. - A `script.js` file for the JavaScript logic. All files should be included in a zip format, ensuring that they are well-organized and easy to understand, with comments where necessary.
AdTONX Telegram Mini App
Create a fully functional Telegram Mini App named AdTONX with the following features and integrations: 1. User Features: - Watch ads from Monetag, Adexium, and Adsgram networks to earn TON cryptocurrency with tiered and CPM reward systems. - Complete official, partner, and user-paid tasks, with user-paid tasks allowing task creation by paying TON, using the specified pricing formula. - Use a referral system that rewards 10% commission on referrals' lifetime earnings plus a 0.005 TON bonus per active referral after the referral watches 50 ads. - Withdraw earnings securely to their TON wallet with a 20% fee and minimum withdrawal of 2 TON. - Display a leaderboard of weekly top earners who have watched at least 1000 ads. - Show rewards notifications with toast messages and sound effects. - Provide a splash screen with an animated logo and loading state referencing the provided logo and welcome page links. - Use a blockchain-themed UI color scheme with professional and Telegram-compliant UI/UX. 2. Admin Panel: - Secure admin login with given credentials. - Dashboard with key metrics, charts, and system statuses. - User management including viewing, banning, and editing user details. - Manage all task types with creation, pausing, and refund options. - Approve and reject withdrawal requests with fee handling. - Manage ad network switches and reward settings. - View referrals, transactions, platform settings, logs, and security tools. 3. Technical and Integration Requirements: - Integrate Firebase (Firestore, Authentication) using provided config; real user authentication with Lovable Cloud. - Implement Telegram WebApp SDK with secure initData validation for user auth. - Integrate specified ad networks with provided code snippets for Monetag, Adexium, and Adsgram. - Design frontend as responsive SPA using vanilla JS, HTML5, CSS3, deployable on GitHub Pages. - Use backend-less architecture initially with Firebase Cloud Functions or serverless functions as optional backend. - Implement anti-fraud features like ad cooldown (10s), daily ad limits (3000), IP/device fingerprinting, and task verification. - Configure Firebase Firestore collections for users, transactions, tasks, withdrawals, settings, and admins with given schemas and security rules. - Provide smooth balance animations, countdown ad timers, progress bars, screen transitions, and confetti on success. - Include haptic feedback and sound on reward events. - Provide complete documentation for further development and deployment. 4. Additional Details: - Handle economics safely ensuring zero investment model, platform reserve coverage, pre-funded user tasks, and revenue from ads and fees. - Provide multi-tab navigation: Home, Ads, Tasks, Wallet. - Ensure instant balance updates and notifications. - Leaderboard display limited to users with minimum 1000 ads watched weekly. 5. Output Instructions: - Provide the complete source code of the Mini App frontend and Admin Panel with deployment ready configurations. - Include integration scripts, Firebase security rules, and detailed setup instructions. - Ensure no mock or simulated data; all functionalities fully operational. - Include comments and documentation within code. 6. Use the provided assets and credentials exactly and securely. Priority: Ensure full functionality, security, and real-world readiness, then polish UI/UX for a professional look. # Output Format - Structured, commented source code files for frontend (App.tsx and related), admin panel HTML/JS/CSS, and Firebase rules. - Step-by-step setup and deployment guide. - README with architecture overview and usage instructions. # Notes - Do not use mock data; connect all features to real Firebase and Telegram APIs. - Strictly enforce ad watching limits, cooldowns, and referral conditions. - Admin panel must be accessible via secure login and able to manage all platform aspects. - Provide notifications and sounds on earnings to enhance engagement. - Use blockchain thematic style and smooth animations. - Leaderboard should update weekly based on ads watched. # Examples - Reward toast example: "🎉 You've earned 0.005 TON!" - Splash screen: animated logo followed by welcome page with link https://ibb.co/RkbdNmfv - Referral link format: https://t.me/AdTONX_BOT?start=ref_{USER_ID} Make sure everything is integrated to create a deployable, professional Telegram Mini App and Admin Panel named AdTONX as specified.