Package & Library Usage

A shared folder with AI prompts and code snippets

From workspace: Replit

Team: AI Prompts

Total snippets: 9

Replit

Package & Library Usage

9 snippets

Use Supabase JS to Insert a Row

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

Use BeautifulSoup to Scrape Links

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>

Use D3.js to Draw a Pie Chart

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

Use SQLAlchemy to Define Models

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

Use TailwindCSS for Button Styles

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>

Use Axios to Fetch API Data

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.

Use Matplotlib to Plot Bar Chart

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.

Use Lodash to Manipulate Arrays

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]

Use Pandas to Clean a CSV

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...

Replit - Package & Library Usage - AI Prompts & Code Snippets | Snippets AI