Skip to content

Instantly share code, notes, and snippets.

View michaelneale's full-sized avatar
😀
Not updating github status

Michael Neale michaelneale

😀
Not updating github status
View GitHub Profile
@michaelneale
michaelneale / example_usage.go
Created December 9, 2022 02:02
ChatGPT writes a golang key/value store abstraction
store := &InMemoryKVStore{data: make(map[string]string)}
store.Set("key1", "value1")
value, err := store.Get("key1")
if err != nil {
// handle error
}
store.Delete("key1")
results, err := store.Query("value")
if err != nil {
// handle error

Explain code

This uses AI to read and try and understand the code, and explain it back to you:

example:

curl --request POST --header 'Content-Type: application/json' \
--url https://us-east1-micprojects.cloudfunctions.net/ai-code-explainer 
This is a riddle solver.
###
Riddle: Whats black and white and red all over?
Answer: A newspaper
###
Riddle: What dries by getting wet?
Answer: A towel
def honeycomb_setup() {
script {
env.STEP_START = sh(script:'date +%s', returnStdout: true).trim()
env.STEP_SPAN_ID = sh(script:'uuidgen', returnStdout: true).trim()
}
}
def install_buildevents() {
sh"""
curl -L -o buildevents https://github.com/honeycombio/buildevents/releases/latest/download/buildevents-linux-amd64 curl -L -o buildevents https://github.com/honeycombio/buildevents/releases/latest/download/buildevents-linux-amd64
chmod 755 buildevents
import streamlit as st
import pandas as pd
import altair as alt
import urllib
from streamlit.server.server import Server
from streamlit.report_thread import get_report_ctx
@st.cache
def get_UN_data():
import base64
import os
from google.oauth2 import service_account
import googleapiclient.discovery
def hello_pubsub(event, context):
# need to install stuff - selenium/webdriver/firefox driver/gecko or something, I forget now.
# Just mash the keyboard until it works.
my_url='https://bws.com.au/spirits/gin'
from selenium import webdriver
options = webdriver.FirefoxOptions()
options.add_argument('-headless')
//def ConfigEnviroment = [:]
//ConfigEnviroment['fromEmail'] = "noreply@adobe.com"
def info(message) {
echo "INFO: ${message}"
}
def warning(message) {
echo "WARNING: ${message}"
}
pipeline {
stages {
stage('cypress - test') {
agent {
docker {
image 'cypress/base:8'
}
}
apiVersion: v1
items: []
kind: List
metadata:
resourceVersion: ""
selfLink: ""