Skip to content

Instantly share code, notes, and snippets.

View thdotnet's full-sized avatar

Thiago Custodio thdotnet

  • Xpirit USA
  • Texas, USA
View GitHub Profile
@thdotnet
thdotnet / main.bicep
Created May 23, 2024 13:21
bicep file to create azure search + storage account + open ai service
// Variables
var location = 'eastus'
var storageAccountName = 'yourstorageaccountname' // Change to a unique name
var searchServiceName = 'yoursearchservicename' // Change to a unique name
var openAIServiceName = 'youropenaiservicename' // Change to a unique name
// Storage Account
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: storageAccountName
location: location
@thdotnet
thdotnet / gist:4c1968781b74a4864a05374742bac52b
Last active January 27, 2024 15:21
combine audio and video files with ffmpeg
ffmpeg -i '.\video.mp4' -i '.\audio.m4a' -c:v copy -c:a aac day5.mp4
@thdotnet
thdotnet / nba-azure.txt
Created November 22, 2022 22:19
url sample
NBA and Microsoft team up to transform fan experiences with cloud application modernization
Posted on November 16, 2022
Ashmi Chokshi General Manager, Azure Digital and Application Innovation
There’s nothing quite like watching a basketball game and cheering on your favorite team as they battle it out for points before the buzzer sounds. From the players and employees to the technology, all need to work in lockstep to deliver a truly immersive experience.
As fans, we expect personalized experiences that bring the virtual world and the real world together on and off the court. This means brand new viewing experiences and virtual reality, real-time highlights of our favorite basketball games, and seamless ways to connect with other fans (and rivals!) when we want, how we want.
Having the right technology partner and cloud-based app transformation strategy is necessary to help organizations like the National Basketball Association (NBA) continue to deliver such unforgettable experiences and exceed fan expecta
dependencies
| extend contextId = tostring(customDimensions["ProcessFunction-Context ID"])
| extend rowsCount = toint(customDimensions["ProcessFunction-Context ID|RowsCount"])
| extend processedCount = toint(customDimensions["ProcessFunction-RowsInjected"])
| where contextId == "d459341f-5d68-469e-bec1-27090bda91dc"
| project rowsCount, processedCount, timestamp
| render columnchart kind=unstacked
dependencies
| extend parentId = tostring(customDimensions["ChangeFeedProcessor-Context ID"])
@thdotnet
thdotnet / gist:5cbf2e9af85cd826b5e56f536bf9b648
Last active January 31, 2022 18:33
fixing The subscription is not registered to use namespace 'Microsoft.AzureActiveDirectory'
# 1
Start up a shell and type the following command.
az login
This will start up a browser and you will need to log into Azure.
# 2
Use the account list command you can get a list of your subscriptions.
using System;
using System.Linq;
using System.Linq.Expressions;
namespace Logic.Movies
{
internal sealed class IdentitySpecification<T> : Specification<T>
{
public override Expression<Func<T, bool>> ToExpression()
{
using System;
using System.Linq.Expressions;
namespace Sample
{
public class GenericSpecification<T>
{
public Expression<Func<T, bool>> Expression { get; }
public GenericSpecification(Expression<T, bool> expression)
apiVersion: apps/v1
# The type of workload we are creating
kind: Deployment
metadata:
# Name of deployment - Required
name: aks-web-app-deployment
spec:
replicas: 2
selector:
matchLabels:
apiVersion: v1
# The type of workload we are creating
kind: Service
metadata:
# Name of Service - Required
name: aks-web-app-service
# Specific details about the Service
spec:
# Type of Service to be deployed
type: LoadBalancer
@thdotnet
thdotnet / gist:4781ad32ab126da27af144ab6e90f928
Created September 24, 2021 12:58
load and interpret JS scripts
//sample.js
window.onload = function () {
var setInnerHTML = function (elm, html) {
elm.innerHTML = html;
Array.from(elm.querySelectorAll("script")).forEach(oldScript => {
const newScript = document.createElement("script");
Array.from(oldScript.attributes)
.forEach(attr => newScript.setAttribute(attr.name, attr.value));
newScript.appendChild(document.createTextNode(oldScript.innerHTML));