Skip to content

Instantly share code, notes, and snippets.

@ithomas51
ithomas51 / Code.gs
Created June 12, 2025 19:48 — forked from dexterlabora/Code.gs
Meraki Webooks Demo with Google Sheets
/*
Copy this function over the existing Code.gs file in a Google Sheet
Save the Sheet/Script
Publish App
- Execute as You
- Avaiable to Anyone (including anonymous)
Authorize App when prompted
The URL will act as the Webhook URL for Meraki to send alerts
*/
@robconery
robconery / csproj-snippet.json
Last active November 17, 2023 05:10
.NET Template JSON
"nuget": {
"prefix": "nuget",
"body": [
"\t<PropertyGroup>\t\t",
"\t\t<PackageId>$1</PackageId>",
"\t\t<PackageVersion>1.0</PackageVersion>",
"\t\t<Title>$2</Title>",
"\t\t<Authors>Rob Conery</Authors>",
"\t\t<Description>$3</Description>",
"\t\t<PackageTags>dotnet;</PackageTags>",
@ithomas51
ithomas51 / appsettings.Development.Serilog.json
Last active October 14, 2024 21:26
serilog configuration file
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File",
"Serilog.Sinks.Async"
],
"MinimumLevel": {
"Default": "Information",
"Override": {
@ithomas51
ithomas51 / private_fork.md
Created April 22, 2023 16:20 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@DamianEdwards
DamianEdwards / Program.cs
Created August 6, 2022 00:32
Some SwashBuckling with .NET 7 rc.1
using System.Buffers.Text;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
@spaasis
spaasis / SwaggerFeatureGateFilter.cs
Last active March 25, 2025 03:06
Swashbuckle IDocumentFilter for hiding paths based on IFeatureManagement and FeatureGateAttribute
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.FeatureManagement;
using Microsoft.FeatureManagement.Mvc;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
/// <summary>Checks the current Feature Management configuration and removes all paths with disabled features</summary>
public class SwaggerFeatureGateFilter : IDocumentFilter {
private readonly IFeatureManager _featureManager;
@jimevans
jimevans / NetworkInterception.cs
Last active May 31, 2024 07:49
Selenium C# network traffic logging example
public async Task LogNetworkRequests(IWebDriver driver)
{
INetwork interceptor = driver.Manage().Network;
interceptor.NetworkRequestSent += OnNetworkRequestSent;
interceptor.NetworkResponseReceived += OnNetworkResponseReceived;
await interceptor.StartMonitoring();
driver.Url = "http://the-internet.herokuapp.com/redirect";
await interceptor.StopMonitoring();
}
@davidfowl
davidfowl / DTO.cs
Last active June 2, 2023 09:16
Associated types: A demo of what DTOs could look like as a language feature
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapPost("/todos", async (CreateTodo createTodo, TodoDb db) =>
{
// This is where the implicit conversion comes in
db.Todos.Add(createTodo);
@davidfowl
davidfowl / .NET6Migration.md
Last active October 25, 2025 11:33
.NET 6 ASP.NET Core Migration
@davidfowl
davidfowl / Example.cs
Last active June 6, 2023 08:10
An implementation of MessagePipe. Something like a channel but with buffer management so you can peek and advance the message that was read.
using System.Buffers;
using System.Net.WebSockets;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/ws", async (HttpContext context) =>
{
const int MaxMessageSize = 1024 * 1024;