Skip to content

Commit

Permalink
2024-07-15 17:11:39.721584 new snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocerqueira committed Jul 15, 2024
1 parent e87388b commit 9cd6cc8
Show file tree
Hide file tree
Showing 31 changed files with 867 additions and 2,434 deletions.
45 changes: 45 additions & 0 deletions seeker/report.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
--------------------------------------------------------------------------------
2024-07-15 17:11:39.721584
--------------------------------------------------------------------------------
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: snippet/A29.java
deleted: snippet/CalcSLM.java
deleted: snippet/GPA.py
deleted: snippet/bukuserver.sh
deleted: snippet/buttsnatcher.sh
deleted: snippet/copy_files
deleted: snippet/devbox
deleted: snippet/enc.py
deleted: snippet/example_mssql.py
deleted: snippet/fetch_chrome_bypass.py
deleted: snippet/gistfile1.txt
deleted: snippet/main.py
deleted: snippet/netip.Prefix_to_net.IPNet.go
deleted: snippet/pres.py
deleted: snippet/record_camera_stream.sh
deleted: snippet/s3.sh
deleted: snippet/shell
deleted: snippet/spark-local.py
deleted: snippet/timer.py
deleted: snippet/us_inflation.py
deleted: snippet/us_unemployment.py
deleted: snippet/vxlan_hp.py

Untracked files:
(use "git add <file>..." to include in what will be committed)
snippet/Dockerfile
snippet/copilot-generate-inventory-data-python-excel.py
snippet/copilot-python-excel-customer-churn-dataset.py
snippet/copilot-python-fake-scores.py
snippet/create-socket-server.sh
snippet/deep_neural_network.py
snippet/python-script-100-fake-customers-excel-SEED.py
snippet/test.py

no changes added to commit (use "git add" and/or "git commit -a")

--------------------------------------------------------------------------------
2024-07-12 17:12:24.016161
--------------------------------------------------------------------------------
Expand Down
72 changes: 0 additions & 72 deletions seeker/snippet/A29.java

This file was deleted.

669 changes: 0 additions & 669 deletions seeker/snippet/CalcSLM.java

This file was deleted.

24 changes: 24 additions & 0 deletions seeker/snippet/Dockerfile
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"]
14 changes: 0 additions & 14 deletions seeker/snippet/GPA.py

This file was deleted.

64 changes: 0 additions & 64 deletions seeker/snippet/bukuserver.sh

This file was deleted.

25 changes: 0 additions & 25 deletions seeker/snippet/buttsnatcher.sh

This file was deleted.

29 changes: 29 additions & 0 deletions seeker/snippet/copilot-generate-inventory-data-python-excel.py
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 seeker/snippet/copilot-python-excel-customer-churn-dataset.py
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!")
38 changes: 38 additions & 0 deletions seeker/snippet/copilot-python-fake-scores.py
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!")
Loading

0 comments on commit 9cd6cc8

Please sign in to comment.