Skip to content

Instantly share code, notes, and snippets.

💭
Writing code LIVE on twitch.tv/csharpfritz

Jeffrey T. Fritz csharpfritz

💭
Writing code LIVE on twitch.tv/csharpfritz
Block or report user

Report or block csharpfritz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@csharpfritz
csharpfritz / repository.cs
Created Aug 23, 2019
Sample code demonstrating Generic Repository pattern with EF Core and C#
View repository.cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace WebApplication2.Models
{
public interface IGetStoredInDatabase
{
@csharpfritz
csharpfritz / GuessTimeCommand.cs
Created Mar 7, 2019
The Quiltoni Time Guess Game
View GuessTimeCommand.cs
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 / git_tips.cmd
Last active Sep 6, 2018
Git tips and tricks
View git_tips.cmd
# 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 } }
View keybase.md

Keybase proof

I hereby claim:

  • I am csharpfritz on github.
  • I am jeffreytfritz (https://keybase.io/jeffreytfritz) on keybase.
  • I have a public key ASAysH3VC9LXGB4H8s40RyF9bED4ZZF3V9f4Ki27FaIgFwo

To claim this, I am signing this object:

@csharpfritz
csharpfritz / keybase.md
Created Feb 15, 2017
Keybase identity proof
View keybase.md

Keybase proof

I hereby claim:

  • I am csharpfritz on github.
  • I am jeffreytfritz (https://keybase.io/jeffreytfritz) on keybase.
  • I have a public key whose fingerprint is 8378 B9B1 E508 7EFB BAB1 34D8 8A96 CB2B 080C CD83

To claim this, I am signing this object:

@csharpfritz
csharpfritz / nuget-nuspec.xsd
Last active Apr 6, 2018
Test schema for NuGet's packages.config file
View nuget-nuspec.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="nuspec"
elementFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.3"
>
<xs:element name="package">
<xs:annotation>
<xs:documentation source="http://docs.nuget.org/Create/Nuspec-Reference" xml:lang="en">The root element of a package definition</xs:documentation>
</xs:annotation>
View gist:f6008fff20509f744a58
public class ContactsController : ApiController
{
[HttpGet]
public IEnumerable<Contact> GetAll()
{
return new Contact[] {
new Contact { Id = 1, EmailAddress = "barney@contoso.com", Name = "Barney Poland"},
@csharpfritz
csharpfritz / Repository.cs
Created Feb 18, 2014
Generic Telerik Backend Services Repository object
View Repository.cs
public class Repository<T> where T : DataItem
{
private EverliveApp app;
public Repository()
{
this.app = new EverliveApp(ConfigurationManager.AppSettings["apiKey"]);
app.WorkWith().Authentication().Login(ConfigurationManager.AppSettings["apiUser"], ConfigurationManager.AppSettings["apiPass"]);
@csharpfritz
csharpfritz / default.aspx
Last active Dec 20, 2015
Telerik AJAX RadMenu that executes a JavaScript function
View default.aspx
<telerik:RadMenu runat="server" ID="tkMenu">
<Items>
<telerik:RadMenuItem Text="Telerik"></telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
@csharpfritz
csharpfritz / shallowCopy.cs
Created Sep 27, 2011
Example of a shallow copy of a CLR generic List<T>
View shallowCopy.cs
namespace Test
{
public static class ExtMethods
{
public static List<T> Clone<T>(this List<T> thisList)
{
// For-loop allows for later management of the copy.. if we wanted to perform additional operations later
You can’t perform that action at this time.