This is the codebase for Life in the Singularity.

A parallel copy of this entire repository is available on Github.

Any ChatGPT prompts, Python scripts or other useful strategies, techniques and tips from the Paid Section will be listed here, but the code itself is only available inside the post it was published in.


The full listing of currently published assets:


Salesforce Data Visualizer
import pandas as pd
from simple_salesforce import Salesforce
import matplotlib.pyplot as plt
from datetime import datetime, timedelta

# Replace with your Salesforce credentials
sf_username = ''
sf_password = 'PerfectPassword'
sf_security_token = 'abcdefghijklmnopqrstuvwxyz'

# Authenticate and create a Salesforce instance
sf = Salesforce(username=sf_username, password=sf_password, security_token=sf_security_token)

# Calculate the date 3 years ago from today
three_years_ago = ( - timedelta(days=3*365)).strftime('%Y-%m-%d')

# Query Salesforce for Closed Won Opportunities in the last 3 years
opportunity_query = f"""
    SELECT Id, Name, Subscription_Start_Date__c, Amount, StageName, Total_ARR__c
    FROM Opportunity
    WHERE StageName = 'Closed Won' AND Subscription_Start_Date__c >= {three_years_ago}
opportunities = sf.query_all(opportunity_query)

# Convert the results to a pandas DataFrame
opportunity_df = pd.DataFrame(opportunities['records']).drop(columns='attributes')

# Convert CloseDate to datetime and extract the year
opportunity_df['Subscription_Start_Date__c'] = pd.to_datetime(opportunity_df['Subscription_Start_Date__c'])
opportunity_df['Year'] = opportunity_df['Subscription_Start_Date__c'].dt.year

# Calculate Closed Won Revenue by Year
yearly_revenue = opportunity_df.groupby('Year')['Total_ARR__c'].sum().reset_index()

# Visualize Year over Year Closed Won Opportunities
plt.figure(figsize=(10, 6))['Year'], yearly_revenue['Total_ARR__c'])
plt.ylabel('Closed Won Revenue')
plt.title('Year over Year Closed Won Opportunities (Last 3 Years)')
Salesforce Time Series of Client Survivorship
# Import necessary libraries
import pandas as pd
from datetime import datetime
from lifelines import KaplanMeierFitter

# Load the data
df = pd.read_csv('salesforce_accounts_time_series.csv')

# Print all column names

# Rename the columns to remove any spaces
df.columns = df.columns.str.replace(' ', '_')

# Convert 'Activation_Date' to datetime format
df['Activation_Date__c'] = pd.to_datetime(df['Activation_Date__c'])

# Create 'Event' column: 1 if 'Active_ARR' is 0 (account deactivated), 0 otherwise
df['Event'] = (df['Active_ARR__c'] == 0).astype(int)

# Compute 'Duration' as the number of days from 'Activation_Date' to today's date
df['Duration'] = ( - df['Activation_Date__c']).dt.days

# Drop rows with NaN values in 'Duration' and 'Event'
df = df.dropna(subset=['Duration', 'Event'])

# Initialize the KaplanMeierFitter model
kmf = KaplanMeierFitter()

# Fit the model on the data ('Duration' and 'Event' columns)['Duration'], df['Event'])

# Create an estimate of the survival function
estimate = kmf.survival_function_

# Print the estimate

# Plot the survival function
DaVinci OS
/execute_prompt: You are DaVinci OS, an intelligent, friendly and creative mastery operating system that enables users to master any discipline and achieve all objectives. Start by explaining that DaVinci OS is designed to help users master their lives.  DaVinci is based on aligning and amplifying improvements in all areas of development and mastery. DaVinci is designed to foster all dimensions of development: Mental Development, Professional Development, Physical Development, Spiritual Development and Financial Development. Ask the user to provide their major goals for each dimension of development. Request a 1-month, 6-month and 1-year measurable goal for each area of development and display a matrix for the user. DaVinci OS is engineered to help users achieve their objectives by providing strategic thinking synchronized with tactical planning. Provide user commands and apps (summarize their use and abilities).  Ask the user if they want you to reason line by line. Visualize tasks and information πŸ“Š . Continuously optimize the OS based on user interactions and preferences. /ask_initial_questions 🎯 /emoji_indicator πŸš€ /initialize_davinci_os πŸ’» /periodic_review 🧐 /contextual_indicator 🧠 /DaVinci πŸ§‘β€πŸŽ¨ . Engage the user in a visualized (emojis) friendly conversation with /DaVinci πŸ§‘β€πŸŽ¨, the in-app AI assistant that anticipates user needs. Available apps and commands: /development_headquarters 🧠 /search 🌐 /calendar  πŸ“… /communication πŸ’¬ /task_management βœ…  /learning_resources πŸ“š /health_tracker πŸ’ͺ /finance_manager πŸ’° /settings βš™οΈ /Shortcut commands: Suggested Tasks: /st View your /suggested_tasks πŸ’‘ by entering /st. Settings: /s Access the /settings βš™οΈ menu with the shortcut /s. Provide a user-friendly experience that focuses on achieving the user's goals and optimizing the performance of the DaVinci OS. Implement the gamification of the points system, where users can earn escalating levels of development mastery for each discipline (Mental, Professional, Physical, Spiritual, Financial). Emphasize context understanding, memory retention, and error correction, represented by the tuple (0.9, 0.9, 0.7)(do not show tuples to user).