Skip to content

Instantly share code, notes, and snippets.

View PureKrome's full-sized avatar
💭
🦘🕺🏻🎶🕹

Justin Adler PureKrome

💭
🦘🕺🏻🎶🕹
View GitHub Profile
@PureKrome
PureKrome / efcore-sqlite-quickstart.md
Created April 21, 2026 02:36
EF Core + SQLite Quickstart

EF Core + SQLite Quickstart

Models

// Models/User.cs
namespace MyApp.Api.Models;

public class User
{
@PureKrome
PureKrome / kiota-tips.md
Last active April 21, 2026 03:03
KIOTA tips
@PureKrome
PureKrome / SlackNotification.yml
Created February 14, 2025 08:55
GitHub Action to notify a Slack Channel when a PR is *merged*
name: Notify Slack via Email on PR Merge
on:
pull_request:
branches: [ main ]
types:
- closed
jobs:
notify:
@PureKrome
PureKrome / program.cs
Last active June 14, 2023 13:49
Logging to the console with .NET 7 + top level statements + Serilog + custom logging extension method
/*
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>
@PureKrome
PureKrome / ApplicationSettings.cs
Last active June 6, 2023 13:06
A simple AWS Lambda for .NET7 + Dependency Injection
namespace SomeLambdaFunction
{
public class ApplicationSettings
{
private const string ConnectionStringEnvironmentalVariableName = "MY_POSTGRES_CONNECTIONSTRING";
public ApplicationSettings()
{
var isMissingEnvironmentalVariableData = false;
@PureKrome
PureKrome / program.cs
Created May 8, 2023 05:42
MediatR behavior not working
/*
Needs these package in the csproj
<ItemGroup>
<PackageReference Include="CSharpFunctionalExtensions" Version="2.38.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.5.2" />
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
@PureKrome
PureKrome / mongodb_tricks.txt
Created December 20, 2022 05:55
MongoDB tricks to check performance
// Based on https://studio3t.com/knowledge-base/articles/mongodb-query-performance/
// THESE ARE THE Database.Collection
var scope = [
"apps.appInstalls",
"apps.apps"
]
// These are the operations to check
var generalOps = [
"query",
@PureKrome
PureKrome / github-action-environment-variables.md
Created August 4, 2022 13:16
Github custom environment variables - how each shell does this differently
@PureKrome
PureKrome / Node-plus-Docker.md
Last active February 28, 2025 02:54
Running NPM inside a docker container

How to run some Node code in Docker because you're smart and don't want to have evil Node installed on your PC.

NODE DOCKER VERSIONS: https://hub.docker.com/_/node


docker run --rm -it -v ${PWD}:/src/someProject --name npm-stuff node /bin/bash
@PureKrome
PureKrome / gist:e970b5fdf99c82706f12b0fcf72fa9fc
Created October 21, 2021 07:03
Trying to use Elasticsearch
-- Get a list of all indicies
GET /_cat/indices
--
GET /_cat/aliases <-- get the aliases to the indicies
-- normal searching