Skip to content

Instantly share code, notes, and snippets.

View csharpfritz's full-sized avatar
💭
Writing code LIVE on twitch.tv/csharpfritz

Jeffrey T. Fritz csharpfritz

💭
Writing code LIVE on twitch.tv/csharpfritz
View GitHub Profile
@csharpfritz
csharpfritz / git_tips.cmd
Last active September 6, 2018 14:53
Git tips and tricks
# Delete extra branches that are NOT dev or master
git for-each-ref --format '%(refname:short)' refs/heads --merged | ForEach-Object { If("dev","master" -notcont ains $_) { git branch $_ -d } }
@csharpfritz
csharpfritz / GuessTimeCommand.cs
Created March 7, 2019 19:22
The Quiltoni Time Guess Game
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TwitchLib.Client.Models;
namespace Quiltoni.PixelBot.Commands
{
public class GuessTimeCommandOld : IBotCommand
{
@csharpfritz
csharpfritz / repository.cs
Created August 23, 2019 15:09
Sample code demonstrating Generic Repository pattern with EF Core and C#
using System;
using System.Collections.Generic;
using System.Linq;
namespace WebApplication2.Models
{
public interface IGetStoredInDatabase
{
@csharpfritz
csharpfritz / Nav.cs
Created February 13, 2020 23:32
Complex object binding to a Blazor component as a Parameter
public class Nav
{
public string Title { get; set; }
public string Icon { get; set; }
public string Url { get; set; }
}
https://img.wallpapersafari.com/desktop/1600/900/86/42/SxyIEo.jpg
@csharpfritz
csharpfritz / oldmandev.txt
Last active March 24, 2020 16:43
Old Man Developer Quotes
When I was your age, I coded with peeks and pokes.
I used to code with a chisel and a stone tablet
Back in my day, a fork lift was required for hardware upgrades, we didn't have fancy cloud services with sliders to add more memory and disk space
We didn't have network attached source control... instead I called the intern working as a data entry clerk and dictated my code to them for transcription and storage
I was coding before MCSE meant must consult someone else
@csharpfritz
csharpfritz / seeddata.cs
Last active July 15, 2022 19:16
Fritz's Pizza Data
namespace BlazingPizza.Server;
public static class SeedData
{
public static void Initialize(PizzaStoreContext db)
{
var toppings = new Topping[]
{
new Topping()
{
@csharpfritz
csharpfritz / upload.cs
Created December 31, 2022 21:25
Upload a file to Azure Blob storage
var blobServiceClient = new BlobServiceClient(EnvironmentConfiguration.TableStorageConnectionString);
var containerClient = blobServiceClient.GetBlobContainerClient("cache");
var client = containerClient.GetBlobClient("fileToCache.json");
await client.UploadAsync(myContentToCacheAsStream, true);
@csharpfritz
csharpfritz / indexChannels.cs
Created February 24, 2023 01:20
Test Twitch Channel Indexing with ElasticSearch
public class IndexChannels {
public async Task Execute() {
var client = new ElasticClient("ID", new ApiKeyAuthenticationCredentials("API KEY"));
CreateChannelIndex(client);
await MigrateChannelsFromSqlServer(client);
@csharpfritz
csharpfritz / about.razor
Last active February 21, 2024 18:28
C# in the Cards About Page snippet
@page "/About"
@attribute [OutputCache(Duration = 600)]
<PageTitle>C# in the Cards - About Us</PageTitle>
<HeadContent>
<link rel="canonical" href="https://csharpinthecards.com/about" />
<meta name="title" content="C# in the Cards - About Us">
<meta name="description" content="C# in the Cards is an innovative video training series that teaches the fundamentals of C# programming language using a deck of cards. Join Microsoft instructor and Twitch streamer Jeff Fritz on this exciting journey.">
<meta name="keywords" content="C#, Programming, Learning, Video Series, Jeff Fritz, Microsoft, Twitch, Education, Coding, Deck of Cards, Interactive Learning">