Skip to content

Instantly share code, notes, and snippets.

View chrisking's full-sized avatar

Chris King chrisking

View GitHub Profile
@chrisking
chrisking / program_output.txt
Created October 28, 2023 18:09
silly grocery program
Python 3.11.2 (main, Mar 23 2023, 02:57:04) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from groceriesapp.models import *
>>> sl = ShoppingList.objects.get(id=1)
>>> sl.render_shopping_list()
Canned Veggies
--------------
Whole Can Tomatoes (ounces): 119.00

Just a Demo on syntax highlighting in markdown

Shell/Bash

sudo apt-get install -y 

Python

import traceback
import logging
import requests
from django.core.management.base import BaseCommand, CommandError
from apps.ufcstats.models import Fighter, Prediction, SportsBook, Odds, MLModel
from django.conf import settings
logger = logging.getLogger(__name__)
# Fighter Alias Dict for storing name screw ups
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from icrawler.builtin import BingImageCrawler
import random
import pprint
mitFilter=True
filters = dict(type='photo',
license='commercial,modify') # either photo, face, clipart, linedrawing, animated
@chrisking
chrisking / list_of_celebrities.txt
Last active August 18, 2022 22:07
list of celebs
Aaron Taylor-Johnson
Abigail Breslin
Adam Sandler
Adele
Adriana Barraza
Adrianne Palicki
Adrien Brody
Al Pacino
Alan Alda
Alan Arkin
@chrisking
chrisking / lookout.md
Created January 19, 2022 16:08
Lookout Guide

Learning to Communicate with Lookout for Metrics

Intro

Amazon Lookout for Metrics uses machine learning (ML) to automatically detect and diagnose anomalies (i.e. outliers from the norm) in business and operational data, such as a sudden dip in sales revenue or customer acquisition rates. In a couple of clicks, you can connect Amazon Lookout for Metrics to popular data stores like Amazon S3, Amazon Redshift, and Amazon Relational Database Service (RDS), as well as third-party SaaS applications, such as Salesforce, Servicenow, Zendesk, and Marketo, and start monitoring metrics that are important to your business.

That said, it is still a computer system and at the end of the day it will respond accordingly to the specific inputs it is given. This is designed to be a short guide to help you think through the data you provide Lookout for Metrics and to better understand what the results from Lookout for Metrics mean. This will be done using a few real world-esque scenarios.

What Exactly Is A Metric?

If

@chrisking
chrisking / sample.md
Last active January 14, 2022 20:28
Thinking about l4m

Learning to Communicate with Lookout for Metrics

Intro

Amazon Lookout for Metrics uses machine learning (ML) to automatically detect and diagnose anomalies (i.e. outliers from the norm) in business and operational data, such as a sudden dip in sales revenue or customer acquisition rates. In a couple of clicks, you can connect Amazon Lookout for Metrics to popular data stores like Amazon S3, Amazon Redshift, and Amazon Relational Database Service (RDS), as well as third-party SaaS applications, such as Salesforce, Servicenow, Zendesk, and Marketo, and start monitoring metrics that are important to your business.

That said, it is still a computer system and at the end of the day it will respond accordingly to the specific inputs it is given. This is designed to be a short guide to help you think through the data you provide Lookout for Metrics and to better understand what the results from Lookout for Metrics mean. This will be done using a few real world-esque scenarios.

What Exactly Is A Metric?

If

@chrisking
chrisking / sample.py
Created March 9, 2021 16:03
sample lambda
import json
import datetime
from dateutil.parser import parse
import boto3
topic_arn = "arn:aws:sns:us-west-2:059124553121:alertsforlookout"
def send_to_sns(message):
sns = boto3.client("sns")
sns.publish(TopicArn=topic_arn,
@chrisking
chrisking / iam.trustrelationsip
Created January 29, 2021 19:36
iam trust relationship
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lookoutmetrics.amazonaws.com"
},
"Action": "sts:AssumeRole"
}