Skip to content

Instantly share code, notes, and snippets.

@jtrive84
jtrive84 / bsTheme.R
Created August 14, 2024 18:53
Function to change shiny bootstrap theme
sfThemeSelector = function() {
# --------------------------------------------------------------------------
# Allow dynamic update of bootstrap theme.
# --------------------------------------------------------------------------
div(
div(
selectInput(
"shinytheme-selector", "Select theme:",
c("default", shinythemes:::allThemes()),
@StartAutomating
StartAutomating / NotOnAFriday.ps1
Created July 27, 2024 00:36
Gist a little friendly advice about Shipping Software
<#
.Synopsis
Not On a Friday.
.Description
Gist a little bit of friendly advice about the wisdom of shipping software on a Friday.
.Notes
Yes, this runs.
#>
[ValidateScript({
if ([DateTime]::Now.DayOfWeek -eq 'Friday') {
@daveebbelaar
daveebbelaar / document_intelligence.py
Created July 13, 2024 07:08
A service class for interacting with Azure Document Intelligence API.
import logging
import requests
import time
from typing import Union, Dict
from config.settings import get_settings
class DocumentIntelligenceService:
"""
A service class for interacting with Azure Document Intelligence API.
@disler
disler / README.md
Created March 31, 2024 14:34
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@Konfekt
Konfekt / chatgpt-write-msg.py
Last active May 4, 2024 00:02
let ChatGPT write a sensible commit message using an adaptable Python script
#!/usr/bin/env python3
# Adaption of https://github.com/tom-doerr/chatgpt_commit_message_hook/main/prepare-commit-msg
#
# Mark this file as executable and add it into the global hooks folder
# whose path is given by the core.hooksPath configuration variable
# skip during rebase
import sys
if len(sys.argv) > 2:
@jdhitsolutions
jdhitsolutions / Get-GHIssueStats.ps1
Created March 7, 2024 17:59
My solution for the PowerShell Podcast scripting challenge to write PowerShell code to get GitHub issue statistics.
#requires -version 7.4
<#
This function requires the gh.exe command line tool.
You many encounter API rate restrictions under heavy use.
#>
#load the custom formatting file
Update-FormatData $PSScriptRoot\ghLabelStatus.format.ps1xml
@tanaikech
tanaikech / submit.md
Last active April 15, 2025 01:46
Guide to Function Calling with Gemini and Google Apps Script

Guide to Function Calling with Gemini and Google Apps Script

Abstract

Powerful AI tool Gemini's API release (Vertex AI & Google AI Studio) opens doors for diverse applications. Its recent upgrade to version 1.5 boosts capabilities. This report demonstrates using simple Google Apps Script function calls to leverage Gemini's power for both data retrieval and content generation.

Introduction

The recent release of the LLM model Gemini as an API on Vertex AI and Google AI Studio unlocks a world of possibilities. Ref Excitingly, Gemini 1.5 was just announced, further expanding its capabilities. Ref I believe Gemini significantly expands the potential in various situations and paves the way for diverse applications. Notably, the Gemini API can retrieve new data and generate content through function calls. In this report, I introduce the basic flow of function

@JustinGrote
JustinGrote / Get-OpenApiDefinition.ps1
Created February 15, 2024 02:40
Download multiple parts of an OpenAPI spec
using namespace System.Collections.Generic
function Get-OpenApiDefinition {
<#
Fetches the OpenAPI definition from the specified URI and for every ref, downloads the relative file to the destination folder. Currently only works with relative refs
#>
param (
#The source
[Parameter(Mandatory)]
[Uri]$Uri,
@jimbrig
jimbrig / PSWakeOnLan.psm1
Created February 8, 2024 21:40
[PowerShell] Wake on LAN (WOL) and Packet Broadcast to Remote Machine
Function Get-MACAddress {
Param(
[Switch]$Local,
[String]$ComputerName
)
if ($Local) {
$MACAddress = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'" | Select-Object -ExpandProperty MACAddress
} else {
$MACAddress = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'" -ComputerName $ComputerName | Select-Object -ExpandProperty MACAddress
@JustinGrote
JustinGrote / ConvertTo-Markdown.ps1
Created January 27, 2024 00:25
Convert PowerShell Objects to Markdown Display by screen-scraping Format-Table
using namespace System.Collections.Generic
using namespace Microsoft.PowerShell.Commands.Internal.Format
#Inspired by: https://gist.github.com/aaroncalderon/09a2833831c0f3a3bb57fe2224963942
<#
.Synopsis
Converts PowerShell Objects or Format-Table output to Markdown
#>
Function ConvertTo-Markdown {
[CmdletBinding()]