Skip to content

Instantly share code, notes, and snippets.

View rido-min's full-sized avatar
💭
coding

Rido rido-min

💭
coding
View GitHub Profile
@rido-min
rido-min / app.ts
Last active September 20, 2025 04:33
quote-agent
import { App } from '@microsoft/teams.apps'
const app = new App()
app.on('message', async ({ send, activity }) => {
await send(`you said "${activity.text}"`)
})
await app.start()
@rido-min
rido-min / zeroConfigProgram.cs
Last active July 29, 2025 15:46
zero-config
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Agents.Authentication;
using Microsoft.Agents.Authentication.Model;
using Microsoft.Agents.Authentication.Msal;
using Microsoft.Agents.Authentication.Msal.Interfaces;
using Microsoft.Agents.Authentication.Msal.Model;
using Microsoft.Agents.Builder;
using Microsoft.Agents.Builder.App;
@rido-min
rido-min / jwtclient.sh
Created May 6, 2025 14:17
jwtclient.sh
#!/bin/bash
# Check if required tools are installed
if ! command -v curl &> /dev/null || ! command -v jq &> /dev/null; then
echo "Error: This script requires curl and jq to be installed."
echo "Install with: sudo apt-get install curl jq"
exit 1
fi
# Parameters
@rido-min
rido-min / clean.proj.xml
Created April 30, 2025 16:33
clean.proj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="CleanAll">
<Target Name="CleanAll">
<CreateItem Include=".\**\debug\**\*;.\**\release\**\*;.\**\obj\**\*;.\TestResults\**\*;.\**\*.*scc;.\**\*.user">
<Output ItemName="DbgFiles" TaskParameter="Include"/>
</CreateItem>
<Message Text="Deleting Debug Files" Importance="high" />
<Delete Files="%(DbgFiles.Identity)" ContinueOnError="true" TreatErrorsAsWarnings="true">
<Output ItemName="DeletedFiles1" TaskParameter="DeletedFiles"/>
@rido-min
rido-min / miniagent.js
Last active April 15, 2025 16:56
miniagent.js
import express from 'express'
import {
ActivityTypes,
AgentApplication,
MemoryStorage,
CloudAdapter,
authorizeJWT,
loadAuthConfigFromEnv } from '@microsoft/agents-hosting'
#!/bin/bash
resource_group="ridomin-dev"
tunnel_id="ridomin-dev"
if ! devtunnel show $tunnel_id &> /dev/null; then
devtunnel create $tunnel_id -a
devtunnel port create $tunnel_id -p 3978
fi
@rido-min
rido-min / test-bot.js
Created February 11, 2025 05:00
test-with-expect-replies
const { Activity, ActivityTypes, DeliveryModes } = require('@microsoft/agents-activity-schema')
const activity = new Activity(ActivityTypes.Message)
activity.deliveryMode = DeliveryModes.ExpectReplies
activity.text = 'Hello, World!'
activity.recipient = { id: 'bot' }
activity.conversation = { id: 'user' }
activity.channelId = 'test'
activity.serviceUrl = 'bot://bot'
@rido-min
rido-min / uuid.js
Created January 16, 2025 02:48
uuid.js
function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}

JSON-CS (Compact Schema)

C. Vasters (Microsoft) November 2024

Abstract

This document specifies JSON-CS (Compact Schema), a schema language for JSON data that enforces strict typing, modularity, and determinism. JSON-CS provides a clear and self-contained approach to defining JSON data structures, requiring explicit type declarations and reusable, hierarchical type definitions. It

@rido-min
rido-min / clean-lockfile.sh
Created November 28, 2024 00:21
clean-lock-file.sh
cp package-lock.json package-lock.json.bak
jq 'walk(if type == "object" and .link != true then del(.resolved, .integrity) else . end)' package-lock.json.bak > package-lock.json
rm package-lock.json.bak