Skip to content

Instantly share code, notes, and snippets.

View onionhammer's full-sized avatar

Erik O'Leary onionhammer

  • CRF USA
  • Minneapolis, MN
View GitHub Profile
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Orchestration;
using Microsoft.SemanticKernel.SemanticFunctions;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace Microsoft.SemanticKernel.KernelExtensions;
diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
index 476774e13..1593fc081 100644
--- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
+++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
@@ -742,6 +742,12 @@ namespace Microsoft.Azure.Cosmos.Linq
SqlScalarExpression memberExpression = ExpressionToSql.VisitScalarExpression(inputExpression.Expression, context);
string memberName = inputExpression.Member.GetMemberName(context.linqSerializerOptions);
+ // If the resulting memberName is empty, then the indexer should be on the root of the object.
+ if (memberName == string.Empty)
@onionhammer
onionhammer / deploy-app-revision.ps1
Created October 4, 2022 01:45
Deploy ACA with zero downtime
<#
.DESCRIPTION
deploy-app-revision Creates a new revision of the app, waits for it to be healthy and swaps traffic
#>
Param (
[String] $Environment = "some-rg",
[String] $AppName = "some-app",
[String] $HealthcheckPath = "api/healthcheck",
[String] $Subscription = "",
[int] $TimeoutSeconds = 100,
@onionhammer
onionhammer / ObjectQueryExtensions.cs
Last active October 25, 2019 14:17
ObjectQueryExtensions
using System;
using System.Linq;
using System.Linq.Expressions;
public static class ObjectQueryExtensions
{
//FROM : http://vgermain.wordpress.com/2008/09/23/linq-to-sql-how-to-order-with-a-string-typed-expression/ (Modified algorithm - 3/15/2010)
public static IQueryable<TEntity> OrderByExpression<TEntity>(
this IQueryable<TEntity> source, string sortExpression)
{
From 1d2b32e97bbefc77ffe11776c03d59a1bf351e7a Mon Sep 17 00:00:00 2001
Date: Fri, 27 Sep 2019 21:51:04 -0500
Subject: [PATCH] Initial commit
---
.config/dotnet-tools.json | 12 ++++++++++++
.vscode/launch.json | 18 ++++++++++++++++++
main.csx | 3 +++
omnisharp.json | 6 ++++++
4 files changed, 39 insertions(+)
#r "nuget: CsvHelper, 12.1.2"
using System;
using System.Linq;
using System.Net.Http;
using System.Web;
using CsvHelper;
using static System.Web.HttpUtility;
const string apikey = "YOUR KEY";
@onionhammer
onionhammer / random.fs
Created January 20, 2017 21:51
random
// Information
FirstName = "Tester",
LastName = lastname,
Address = choiceFrom fakeAddrs,
Email = "test@connect2capital.com",
Phone = "111-111-1111",
Website = "https://www.google.com",
NameOfBusiness = lastname + ", Inc",
NumEmployees = 1,
FinancedNeededBy = choiceEnum<FinanceTimeline>(),
#load "load-project-debug.fsx"
// REF: https://github.com/MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-/blob/master/docs/PlaybackAPI_WebSocket.md
open System
open System.Net.WebSockets
open System.Threading
open System.Threading.Tasks
open System.Text
open System.Text.RegularExpressions
@onionhammer
onionhammer / fsharpness.fs
Last active October 4, 2015 20:53
Compiles F# to javascript then invokes closure compiler on it, parses response w/ json data provider
#load "Scripts/load-references.fsx"
open System
open System.Net.Http
open System.Collections.Generic
open FSharp.Data
let map (items: seq<'a * 'b>) = items |> Seq.map(KeyValuePair)
type compilationResult = JsonProvider<"""
@onionhammer
onionhammer / alternate.nim
Last active August 29, 2015 14:20
Example
# layout.nim
import templates
proc render*(title, content: string): string =
tmpli html"""
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>$title</title>