https://github.com/SavageCore/xone-steam-deck-installer
Have a repository on GitHub? Planning on making a repository on GitHub? This checklist is intended to introduce you to various features that may help you make the most of your GitHub repository with specific recommendations for C# repositories.
These are only suggestions.
They may not be appropriate for all repositories.
They are in no particular order.
Click each item to expand for more information.
Note: code examples are in C#, but the theory should be applicable to most programing languages
"How do I generate random numbers except for certain values?" - This is a relatively common question that I aim to answer with this post. I wrote some extension methods for the topic that look like this:
Random random = new();
int[] randomNumbers = random.Next(
count: 5,
minValue: 0,
This code is a snippet from the https://github.com/ZacharyPatten/Towel project. Please check out the project if you want to see more code like it. :)
Attributes in C# are great. They let you add metadata onto members of your code that can be dynamically
looked up at runtime. However, they are also a bit of a pain to deal with. You generally have to make your
own class that inherits System.Attribute
and add a decent bit of boiler plate code to look up your attribute
with reflection. Here is an example of making your own attribute:
These are some notes about settings I like to use when I code in Visual Studio. They are completely optional.
- Automatic brace completion = false
- Dark Theme
Tools -> Options -> Environment -> General
- Disable Semicolon Bullshit
Tools -> Options -> Text Editor -> C# -> IntelliSense
- Automatically complete statement on semicolon = false
- Control Click
Tools -> Options -> Text Editor -> General
- Enable mouse click to perform Go to Definition = false
- Shift Key Overrides
Tools -> Options -> Environment -> Keyboard
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace ConsoleApp1 | |
{ | |
class TypeBase<TInterface> | |
{ | |
public virtual Type TheInnerType { get; } | |
} |
Date: July 8, 2014
In this article, I would like to introduce and explain a data structure I have written in C#. This structure has the ability to store items sorted along "N" dimensions. It is similar in concept to a k-d tree (see Wikipedia), but it is NOT implemented as a binary tree. It branches relative to the number of dimensions its items are being sorted upon.
I developed the structure entirely on my own accord, and since I could not find another implementation like it, I am taking the liberty in giving it a name. I have called the structure an "Omni-Tree".
Background
Date: April 24, 2019
In this post I will demonstrate how you can easily load C#|VB|F# XML code documentation and access it via reflection (using extension methods).
Note: The method described in this post only works if you are able to get the “.xml” file generated by Visual Studio when the code is built.
Author Edit (2020.7.27): The latest source code for this topics is included in the https://github.com/ZacharyPatten/Towel repository.
Date: May 12, 2015
I wanted to share a new pattern I developed for perform generic mathematics in C# using runtime compilation.
Over the years I've been coding I have seen several versions of generic math in C#, but none of them have been particularly good. In this section I would like to step through some examples I have seen, and explain why they do not make good patterns for generic math.
I developed this pattern to use as part of my Seven Framework project. Please check out the project here if you are interested: https://github.com/ZacharyPatten/SevenFramework
This code is an example of an extension method that performs multiple string replacements in one method.
This code is included in the Towel Project. Please check it out if you want to see more code like it. :)
using System;
using System.Linq;
using Towel;