Skip to content

Instantly share code, notes, and snippets.

View chenxizhang's full-sized avatar
🎯
Focusing

chenxizhang chenxizhang

🎯
Focusing
View GitHub Profile
@chenxizhang
chenxizhang / prompts.txt
Last active December 31, 2023 07:20
openai_powershell_sdk_prompt_library
# This is the prompt library for openai_powershell_sdk
@chenxizhang
chenxizhang / webpredict.py
Created August 17, 2023 23:53
This is a simplest web app, people can upload an image and get prediction by azure custom vision serivce
from flask import Flask, render_template, request
from dotenv import load_dotenv
import os
import requests
app = Flask(__name__)
load_dotenv()
def classify_image(image_data):
endpoint = "https://japaneast.api.cognitive.microsoft.com/customvision/v3.0/Prediction/44bd0c2b-20c3-43d9-9805-2f5de1476c3b/classify/iterations/Iteration2/image"
@chenxizhang
chenxizhang / predict.py
Last active August 17, 2023 23:06
This is a python app to predict animal and healthy status with azure custom vision service
import requests
from dotenv import load_dotenv
import os
def classify_image(image: str, local: bool = False):
load_dotenv()
if local:
endpoint = "https://japaneast.api.cognitive.microsoft.com/customvision/v3.0/Prediction/44bd0c2b-20c3-43d9-9805-2f5de1476c3b/classify/iterations/Iteration2/image"
headers = {
@chenxizhang
chenxizhang / 单元格赋值.EXCEL.yaml
Created September 24, 2022 08:59
单元格赋值
name: 单元格赋值
description: 单元格赋值
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@chenxizhang
chenxizhang / 基本知识.EXCEL.yaml
Last active September 20, 2022 12:28
介绍了基本知识
name: 基本知识
description: 介绍了基本知识
host: EXCEL
api_set: {}
script:
content: >
// 那些Excel中的脚本 (公众号:code365)
// 作者:陈希章
@chenxizhang
chenxizhang / 随机之美.EXCEL.yaml
Created September 10, 2022 10:35
随机数以及它在Excel中的有趣应用
name: 随机之美
description: 随机数以及它在Excel中的有趣应用
host: EXCEL
api_set: {}
script:
content: |+
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@chenxizhang
chenxizhang / 读取当前脚本运行环境信息.EXCEL.yaml
Created September 8, 2022 13:08
读取应用程序和平台信息
name: 读取当前脚本运行环境信息
description: 读取应用程序和平台信息
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
Office.onReady(async (info)=>{
@chenxizhang
chenxizhang / 引用外部模块.EXCEL.yaml
Created September 7, 2022 01:26
本例演示了如何引用外部的npm模块来简化编程
name: 引用外部模块
description: 本例演示了如何引用外部的npm模块来简化编程
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@chenxizhang
chenxizhang / 读取远程图片并插入文档.EXCEL.yaml
Last active September 6, 2022 00:57
读取网络图片,并且解析,然后写到工作表中
name: 读取远程图片并插入文档
description: 读取网络图片,并且解析,然后写到工作表中
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@chenxizhang
chenxizhang / 选择图片并插入文档.EXCEL.yaml
Created September 5, 2022 13:02
Create a new snippet from a blank template.
name: 选择图片并插入文档
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {