Skip to content

Instantly share code, notes, and snippets.

Avatar
🐦
:parrotwave1::parrotwave2::parrotwave3::parrotwave4::parrotwave5::parrotwave6:

Aaron Dandy aarondandy

🐦
:parrotwave1::parrotwave2::parrotwave3::parrotwave4::parrotwave5::parrotwave6:
View GitHub Profile
@aarondandy
aarondandy / CacheTesting.cs
Created Jul 9, 2020
async blocking memory cache
View CacheTesting.cs
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace CacheTesting
{
class Program
@aarondandy
aarondandy / netcore linecount
Last active Jan 23, 2020 — forked from hyrmn/netcore linecount
netcore 3.1. hardcoded to the location of a 1.6gb text file
View netcore linecount
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.IO;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
namespace BensWordCounter
{
View IMapperEnterpriseMonadFactoryMapperFactory
public class FooCopier
{
public static FooCopier Default { get; } = new FooCopier();
public static FooCopier WithoutBar { get; } = new FooCopier(skipBar: true);
private readonly IMapper mapper;
public FooCopier(bool skipBar = false)
{
@aarondandy
aarondandy / ChannelSample.cs
Created Jan 1, 2019
Simple Sample for System.Threading.Channels
View ChannelSample.cs
// Install System.Threading.Channels
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
View Mayonnaise.cs
// reference SqlStreamStore.Postgres, Newtonsoft.Json
// use C# 7.3+
using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SqlStreamStore;
using SqlStreamStore.Streams;
@aarondandy
aarondandy / text-reverse-speeds
Last active Sep 14, 2018
Just messing around, seeing how to reverse strings faster. Add benchmarkdotnet. Use C# 7.3, Core2.1+. Build Release.
View text-reverse-speeds
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
View words.cs
using System.Collections.Generic;
using System.Linq;
using Hunspell;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
View minecraft-map-gen.ahk
^!g::
CenterX:=616
CenterZ:=764
RadiusMin:=940
RadiusMax:=15000
RadiusStep:=64
CircumStep:=64
FlyHeight:=220
Delay:=8000
@aarondandy
aarondandy / Encrypt.cs
Last active Aug 1, 2016
Bad encryption
View Encrypt.cs
using System;
using System.Security.Cryptography;
using System.Text;
namespace EncryptPassword
{
class Program
{
static void Main(string[] args)
{
@aarondandy
aarondandy / PointProgram.cs
Created Jan 18, 2014
Simple point performance test.
View PointProgram.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace PointBandwidthTest
{
class Program
{