Skip to content

Instantly share code, notes, and snippets.

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

Justin Adler PureKrome

💭
🦘🕺🏻🎶🕹
View GitHub Profile
@PureKrome
PureKrome / rider-debugging-external-code-private-repo.md
Last active August 16, 2021 03:28
Debugging .NET Core external code from a private GitHub repo

HOWTO: Debug .NET Core external code from a 🔒 private GitHub repository, using JetBrains Rider

GITHUB: Create a GitHub "PAT" (Personal Access Token)

To access any locked/private resources in GitHub, you need a PAT. This is a specific access key that you can create to unlock whatever resource you own.

  • Login to GitHub
  • Click on your avatar icon (top right corner) -> Settings
  • Now click Developer Settings -> Personal Access Tokens
  • Click "Generate New Token" button
@PureKrome
PureKrome / gitconfig setup.md
Last active September 11, 2021 08:31
Setting up gitconfig for different work/personal folders/projects

Summary

  • Have different username/email settings for WORK or PERSONAL projects
  • Uses the includeIf hack (unfortunately)
  • To get this to work (or test) the folder needs to have had git init already occur on it.
  • Hack the global .gitconfig file
  • Add separate .gitconfig files where you want have separate settings for different work / personal / serious-projects.
  • For Windows OS, you need to use case -INSENSITIVE- git command => gitdir/i .. most examples say to use gitdir but that fails on Windows OS.
@PureKrome
PureKrome / Notes.md
Last active June 9, 2021 08:44
Running a docker image which shares a windows folder with a folder inside the docker instance

docker run --rm -it -v ${PWD}:/src/scripts --name XXXXXX IMAGENAME /bin/bash

  • --rm this instance will be deleted once we 'exit' the image
  • -it interactive mode
  • -v sharing folders (called sharing VOLUMES)
  • ${PWD} source folder
  • : denotes that we're sharing between these two volumes
@PureKrome
PureKrome / mongodb-cli-cheatsheet.md
Last active November 13, 2022 05:02
🚀 MongoDB CLI newbie cheat sheet 🤘🏻

MongoDB -CLI- Cheat Sheet

  • You do NOT need to have MongoDB "installed" on your machine.
  • Leverage docker images and persist your data via docker 'volumes'.

Start a docker instance.

Create a mongo docker instance (from an image) and start a new shell (this is not a MongoDB shell .. just a normal BASH shell)

  • NOTE: check the volumn settings for your OS. This is a windows example, which connects the files in the current directly, to a specific folder inside the docker image.
@PureKrome
PureKrome / backend-storage-azurite.yml
Created August 22, 2019 10:07
Azurite in a Kubernetes setup
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: storage-azurite-deployment
spec:
replicas: 1
selector:
matchLabels:
tier: backend
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Hornet.Core.Storage.EventBus
{
public interface IEventBus
{
string Name { get; }
Task PublishAsync<T>(T @event) where T : class, IEvent;
@PureKrome
PureKrome / program.cs
Last active November 29, 2018 08:22
Playing around with the new .NET Generic Host in .NET Core 2.1+
//
// REF: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-2.1
// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1#add-providers
// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1#memory-configuration-provider
//
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@PureKrome
PureKrome / DocumentStoreExtensions.cs
Created September 20, 2018 09:30
RavenDb DocumentStore extensions class for simplifying the setup of RavenDb in a .NET Core app
using Microsoft.Extensions.Logging;
using Polly;
using Raven.Client.Documents;
using Raven.Client.Documents.Indexes;
using Raven.Client.Documents.Operations;
using Raven.Client.Exceptions.Database;
using Raven.Client.Exceptions.Security;
using Raven.Client.ServerWide;
using Raven.Client.ServerWide.Operations;
using System;
@PureKrome
PureKrome / program.cs
Created August 30, 2018 04:08
Sample program.cs
using Microsoft.ApplicationInsights;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Serilog;
using System;
using System.IO;
namespace Hornet.Api
@PureKrome
PureKrome / SlowRequestController.cs
Last active August 18, 2017 13:47
Testing a slow request (like a bad performing DB query)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace wwwlearn.Controllers
{