Skip to content

Instantly share code, notes, and snippets.

View mariobot's full-sized avatar
🔄
Working - Learning

Mario Botero mariobot

🔄
Working - Learning
View GitHub Profile
@dmauser
dmauser / azfwpolicynetrule.azcli
Last active March 19, 2024 21:01
Azure Firewall Policy and adding a network rule using Azure CLI
## Firewall Policy and network rules over CLI
# Variables:
Commands to create a networking rule with Firewall Policy:
#Create firewall rules
fwpolicyname=NewPolicyTest #Firewall Policy Name
rg=FW-Policies # Set your Resource Group
@Swimburger
Swimburger / Program.cs
Created March 16, 2022 21:35
ASP.NET Minimal API sample for Twilio webhooks
using Microsoft.AspNetCore.Mvc;
using Twilio.AspNet.Core.MinimalApi;
using Twilio.TwiML;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.MapGet("/sms", ([FromQuery] string from, [FromQuery] string body) =>
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
private static void SqlDataReaderToCSV(SqlDataReader reader, string path)
{
using (StreamWriter writer = new StreamWriter(path))
{
string[] headers = new string[reader.FieldCount];
for (int i = 0; i < reader.FieldCount; i++)
{
headers[i] = string.format("{0}", reader.GetName(i));
}
writer.WriteLine(string.Join(",", headers));
@pksunkara
pksunkara / config
Last active July 28, 2024 08:58
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta