Skip to content

Instantly share code, notes, and snippets.

View dotnetchris's full-sized avatar

Chris Marisic dotnetchris

View GitHub Profile
@dotnetchris
dotnetchris / Base58.cs
Last active April 3, 2023 13:10
Base58 is case SENSITIVE alphanumeric ELIMINATING: 0 (zero), I (uppercase), O (uppercase), l (lowercase)
/// <summary>
/// Base58 is case SENSITIVE alphanumeric ELIMINATING: 0 (zero) I (uppercase), O (upppercase), l (lowercase)
/// This reduction of characters eliminates the majority of human typoposition errors
/// </summary>
public class Base58
{
private static readonly BaseN base58 = new BaseN("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); //base58
public static string Encode(long @long) => base58.Encode(@long);
@bretcope
bretcope / 1 - Map Arguments to Properties.cs
Last active March 12, 2019 05:33
Sigil Object Mapping - Basic Examples
// Runnable from Linqpad 5
// Must install the Sigil nuget package and include the Sigil namespace
void Main()
{
var createSample = GetMapperDelegate();
// try it out
createSample(23, "Hello").Dump();
}
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 23, 2024 11:03
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@dmangiarelli
dmangiarelli / GitForWindowsSetup.md
Last active March 22, 2023 22:20
How to setup SSH with Git for Windows

How to setup Git for Windows

I know this document seems long, but it shouldn't be too difficult to follow. This guide is based on Windows, but every program here has Linux/Mac equivalents, and in most cases they're built-in. So, take a deep breath and go step by step.

The steps below are for GitHub, but the steps are almost idential for Bitbucket, Heroku, etc.

You'll probably want to make sure Chocolatey is installed, since it streamlines installing this stuff later. If you install via Chocolatey, you don't need to run the installers from the products' respective sites.

Cmder / ConEmu

@dotnetchris
dotnetchris / gist:3298615
Created August 8, 2012 20:44
Restful ASP.NET MVC C# controller
[Authorize("Users")]
public class ProfileController : ResourceController
{
private readonly UserReports _userReports;
private readonly Func<UserService> _userServiceFactory;
private readonly ILogger _logger;
private readonly Func<ProfileViewModelValidator> _validatorFactory;
public ProfileController(UserReports userReports, Func<UserService> userServiceFactory, Func<ProfileViewModelValidator> validatorFactory, ILogger logger)
{