A shared folder with AI prompts and code snippets
From workspace: Replit
Team: AI Prompts
Total snippets: 9
9 snippets
Insert a new row using Supabase JavaScript client.
Use Supabase JavaScript client to insert a row. Table: profiles Fields: – id (auto) – username: 'alina' – website: 'https://snippets.ai' Include: – Setup client – Insert call – Handle result
Extract all hyperlinks from HTML using BeautifulSoup.
Use BeautifulSoup to extract all `<a href="">` links. HTML: <html> <body> <a href="https://example.com">Example</a> <a href="https://test.com">Test</a> </body> </html>
Draw a pie chart in D3.js with labels and colors.
Use D3.js to draw a simple pie chart. Data: [ {label: 'A', value: 30}, {label: 'B', value: 50}, {label: 'C', value: 20} ] Include: – Color legend – Percentage labels – SVG setup
Define a User and Post model using SQLAlchemy ORM.
Define SQLAlchemy models with relationships. Models: – User: id, name, email – Post: id, title, user_id (FK) Include: – Base class – One-to-many relationship – `__repr__` methods
Create a styled button using Tailwind utility classes.
Use Tailwind CSS to style a button. Style: – Blue background – White text – Rounded corners – Hover effect (darker blue) HTML: <button>Click Me</button>
Show how to fetch and log JSON data from an API with Axios.
Use Axios to: – Fetch data from https://jsonplaceholder.typicode.com/posts – Log first 3 post titles to the console – Handle fetch errors Explain each step.
Plot a labeled bar chart using Matplotlib.
Use Matplotlib to create a bar chart. Data: products = ['A', 'B', 'C'] sales = [120, 300, 90] Chart should: – Show labels – Add title 'Product Sales' – Color bars Also show the final rendered chart.
Demonstrate array filtering and transformation using Lodash.
Use Lodash to: – Remove falsy values – Sort array descending – Return only even numbers Input: [0, 1, false, 2, '', 3, 4]
Show how to clean and transform a CSV using Pandas.
Show how to clean this CSV using Pandas. Tasks: – Remove rows with missing 'email' – Convert 'signup_date' to datetime – Filter users with 'active' == True Data: users.csv | id | email | signup_date | active...