Skip to content

Instantly share code, notes, and snippets.

# 1. Defining Methods in a Class
class Tire:
"""A tire that a mechanic works with"""
def __init__(self, brand, size, pressure_psi):
"""Initialize a new tire"""
self.brand = brand
self.size = size # e.g., "225/65R17"
self.pressure_psi = pressure_psi
@specialorange
specialorange / gist:db6061f9112aa48f49d69cd9fa2b3647
Created November 5, 2025 03:20
REAL code that texts the managers daily
# This means its run daily
@shared_task
# Method Name # Arguments
# # This is required
# # This is optional
def updateManagersDaily(fleetSlugs, execution_id=None):
#these are known as docs - notes for humans to
#read about what the method actually does
"""
Process daily updates for multiple accounts/fleets.
1. Using List Methods
# Managing today's service queue
# Type: list
service_queue = ["Tire Rotation", "Flat Repair", "Balance", "Alignment"]
# Add new service to the end
service_queue.append("Tire Replacement")
print(f"Queue: {service_queue}")
@specialorange
specialorange / atires.py
Last active June 18, 2021 14:43
Python Tire data analysis
# Here is my analysis of the process and data you have asked me to provide.
# Emails and process regarding onboarding:
#   Please consider allowing for better time management, and describing the process up front.   It is frustrating to be strung along a process without knowing the process.  A more refined process would be welcome.
# Data:
#  - Please ensure the data has been UTF/internationalized. - For non international/German exposed data scientists, explain the German usage of ; and , vs , and .
#  - Have cleaner data (it is not only comma separated, but also has extraneous lines, and is stringified)
#     ( https://superuser.com/questions/180964/how-to-open-semicolon-delimited-csv-files-in-us-version-of-excel )
#  - Provide more clear instructions in the powerpoint, or better yet, in the email/introduction by the recruiter/HR - Provide better documentation, and distinguish between public vs internal documents.
#  - Provide better contextualization of the data descriptions (UNITS!!!!!!)
@specialorange
specialorange / ec2-host-from-tag-to-env-vars.sh
Last active September 8, 2018 21:08 — forked from marcellodesales/ec2-host-from-tag-to-env-vars.sh
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Chris Frisina from Marcello de Sales ([email protected])
# Description: Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policies-ec2-console.html)
# * aws configure
# * Source it to the user's ~/.profile that has permissions