-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-07-15 17:11:39.721584 new snippets
- Loading branch information
1 parent
e87388b
commit 9cd6cc8
Showing
31 changed files
with
867 additions
and
2,434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#date: 2024-07-15T16:41:00Z | ||
#url: https://api.github.com/gists/a45166a36c2eb652bd7c02e2e5bd4a7b | ||
#owner: https://api.github.com/users/itzzjb | ||
|
||
# We will start from a apline version of node.js base image | ||
FROM node:lts-alpine | ||
|
||
# Create a directory to hold the application code inside the image | ||
WORKDIR /usr/src/app | ||
|
||
# Copy package.json and package-lock.json to the image | ||
COPY ./package*.json /usr/src/app | ||
|
||
# Installing all the node_modules according to the package.json file | ||
RUN npm install | ||
|
||
# Copy the rest of the application code to the image | ||
COPY ./ /usr/src/app | ||
|
||
# Expose the port that the app runs on | ||
EXPOSE 3000 | ||
|
||
# Start the application | ||
CMD ["npm","start"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
seeker/snippet/copilot-generate-inventory-data-python-excel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#date: 2024-07-15T16:58:40Z | ||
#url: https://api.github.com/gists/56abe14f64be817384c90b579f147268 | ||
#owner: https://api.github.com/users/summerofgeorge | ||
|
||
import pandas as pd | ||
import numpy as np | ||
from faker import Faker | ||
|
||
# Set the random seed | ||
np.random.seed(1234) | ||
|
||
# Initialize the faker generator | ||
fake = Faker() | ||
|
||
# Generate inventory data | ||
inventory_data = { | ||
'Item ID': [fake.unique.random_number(digits=6) for _ in range(2000)], | ||
'Category': [fake.random_element(['Electronics', 'Clothing', 'Home Goods', 'Sports Equipment', 'Toys']) for _ in range(2000)], | ||
'Stock Level': np.random.normal(loc=100, scale=30, size=2000), | ||
'Reorder Level': np.random.uniform(low=20, high=50, size=2000), | ||
'Lead Time': np.random.exponential(scale=1/0.05, size=2000) | ||
} | ||
|
||
# Create a DataFrame | ||
df = pd.DataFrame(inventory_data) | ||
|
||
# Save to an Excel file | ||
df.to_excel('warehouse_inventory.xlsx', index=False) | ||
print("Excel workbook 'warehouse_inventory.xlsx' created successfully!") |
34 changes: 34 additions & 0 deletions
34
seeker/snippet/copilot-python-excel-customer-churn-dataset.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#date: 2024-07-15T17:02:17Z | ||
#url: https://api.github.com/gists/6218180cf42c9e2297493947befc7031 | ||
#owner: https://api.github.com/users/summerofgeorge | ||
|
||
import pandas as pd | ||
import numpy as np | ||
from faker import Faker | ||
|
||
# Set the random seed | ||
np.random.seed(1234) | ||
|
||
# Initialize the faker generator | ||
fake = Faker() | ||
|
||
# Generate customer churn data | ||
customer_data = { | ||
'Customer ID': [fake.unique.random_number(digits=6) for _ in range(5000)], | ||
'Age': np.random.normal(loc=35, scale=10, size=5000), | ||
'Tenure': np.random.uniform(low=1, high=72, size=5000), | ||
'Monthly Charges': np.random.normal(loc=70, scale=20, size=5000), | ||
} | ||
|
||
# Calculate Total Charges | ||
customer_data['Total Charges'] = customer_data['Monthly Charges'] * customer_data['Tenure'] | ||
|
||
# Generate churn (0 or 1) based on probability | ||
customer_data['Churn'] = np.random.choice([0, 1], size=5000, p=[0.8, 0.2]) | ||
|
||
# Create a DataFrame | ||
df = pd.DataFrame(customer_data) | ||
|
||
# Save to an Excel file | ||
df.to_excel('telecom_customer_churn.xlsx', index=False) | ||
print("Excel workbook 'telecom_customer_churn.xlsx' created successfully!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#date: 2024-07-15T16:55:28Z | ||
#url: https://api.github.com/gists/48fff68259a7c7dd0e406cbad5d86e37 | ||
#owner: https://api.github.com/users/summerofgeorge | ||
|
||
# Use Python and the faker package to create a synthetic Excel dataset for an organization's employee performance review for 500 employees with the following details: | ||
|
||
# - Columns: Employee ID, Department, Performance Score, Salary, Years of Experience | ||
# - Performance Score: Normally distributed with a mean of 70 and a standard deviation of 10 | ||
# - Salary: Log-normally distributed with a mean of $50,000 and a standard deviation of $15,000 | ||
# - Years of Experience: Exponentially distributed with a lambda of 0.1 | ||
# - Department: Randomly chosen from 'Sales', 'HR', 'IT', 'Marketing', 'Finance | ||
# - Random seed: Set to 1234. | ||
|
||
import pandas as pd | ||
import numpy as np | ||
from faker import Faker | ||
|
||
# Set the random seed | ||
np.random.seed(1234) | ||
|
||
# Initialize the faker generator | ||
fake = Faker() | ||
|
||
# Generate employee data | ||
employee_data = { | ||
'Employee ID': [fake.unique.random_number(digits=6) for _ in range(500)], | ||
'Department': [fake.random_element(['Sales', 'HR', 'IT', 'Marketing', 'Finance']) for _ in range(500)], | ||
'Performance Score': np.random.normal(loc=70, scale=10, size=500), | ||
'Salary': np.random.lognormal(mean=np.log(50000), sigma=np.log(15000), size=500), | ||
'Years of Experience': np.random.exponential(scale=1/0.1, size=500) | ||
} | ||
|
||
# Create a DataFrame | ||
df = pd.DataFrame(employee_data) | ||
|
||
# Save to an Excel file | ||
df.to_excel('employee_performance.xlsx', index=False) | ||
print("Excel workbook 'employee_performance.xlsx' created successfully!") |
Oops, something went wrong.