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 |
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 |
RUN pacman -Sqyu --noconfirm --needed openssh && \ | |
systemctl enable sshd | |
# configure ssh | |
RUN sed -i \ | |
-e 's/^#*\(PermitRootLogin\) .*/\1 yes/' \ | |
-e 's/^#*\(PasswordAuthentication\) .*/\1 yes/' \ | |
-e 's/^#*\(PermitEmptyPasswords\) .*/\1 yes/' \ | |
-e 's/^#*\(UsePAM\) .*/\1 no/' \ | |
/etc/ssh/sshd_config |
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
#!/bin/sh | |
remove_dangling() { | |
echo "Removing dangling images ..." | |
docker rmi $(docker images -f dangling=true -q) | |
} | |
remove_stopped_containers() { | |
echo "Removing stopped containers ..." | |
docker rm $(docker ps -qa) |
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}" | |
} |