Skip to content

Instantly share code, notes, and snippets.

View 7effrey89's full-sized avatar

Jeffrey Lai 7effrey89

  • Microsoft
  • Denmark
View GitHub Profile
@7effrey89
7effrey89 / gpt4o-feats-dalle3.py
Created May 22, 2024 20:28
GPT-4o describes an image, and feeds that description into DALL-E3
#Documentation:
#https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line%2Cpython-new&pivots=programming-language-python
#https://medium.com/@alexandre.tkint/dall-e-3-api-getting-started-guide-d945a2249823
#https://platform.openai.com/docs/guides/vision?lang=python
import os
from openai import AzureOpenAI
import webbrowser
#STEP1A: Have GPT4 generate a description of the ring
@7effrey89
7effrey89 / Program.cs
Last active May 22, 2024 20:24
C# Azure Cognitive Search REST API demo - Insert and search for documents in the index
using Newtonsoft.Json.Linq;
namespace CognitiveSearchIndexDemo
{
internal class Program
{
const string searchServiceName = "YouCognitiveServiceName";
const string apiKey = "YouCognitiveServicePIKey";
const string indexName = "YouCognitiveServiceIndexName";
const string apiVersion = "2023-07-01-Preview";
@7effrey89
7effrey89 / Program.cs
Last active August 22, 2023 13:40
Uploading files to ADLS Gen 2 and OneLake using C#
using Azure;
using Azure.Storage.Files.DataLake;
using Azure.Storage.Files.DataLake.Models;
using Azure.Storage;
using System.IO;
using Azure.Identity;
using System.IO.Enumeration;
using System.Net.Http.Headers;
using Azure.Identity;
using Azure.Storage.Files.DataLake;
@7effrey89
7effrey89 / printer.cfg
Last active April 8, 2026 21:12
My Klipper config for Ramps 1.4 using TMC2130 SPI and DRV8825, LCD
# This file contains common pin mappings for RAMPS (v1.3 and later)
# boards. RAMPS boards typically use a firmware compiled for the AVR
# atmega2560 (though other AVR chips are also possible).
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: ar54
dir_pin: !ar55
@7effrey89
7effrey89 / alarmtest.ino
Created May 13, 2018 21:47
WIP - alarm nodemcu
/*
* TimeAlarmExample.pde
*
* This example calls alarm functions at 8:30 am and at 5:45 pm (17:45)
* and simulates turning lights on at night and off in the morning
* A weekly timer is set for Saturdays at 8:30:30
*
* A timer is called every 15 seconds
* Another timer is called once only after 10 seconds
*
@7effrey89
7effrey89 / tm1637noedmcu_Test.ino
Created May 10, 2018 20:12
TM1637 on NodeMCU
/*
Basic usage example
Demonstrated some of the basic functionality of the library. Initialize the display, set the backlight brightness, print some text, count from 0 to 100 and print on display and blink some text.
Note: make sure to set your serial monitor to line end: NEW LINE!
The circuit:
* connect TM1637 pin CLK to NodeMCU pin D4
* connect TM1637 pin DIO to NodeMCU pin D5