Skip to content

Instantly share code, notes, and snippets.

@herman1vdb
herman1vdb / DecimalTetrasexagesimalExtension
Last active March 14, 2016 10:56
Decimal To Tetrasexagesimal and back extension methods C# (logic from http://stackoverflow.com/a/4964352/3325104)
public static class extensions
{
public static char[] baselist = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-".ToCharArray();
public static StringBuilder toNumericBase64(this int number)
{
StringBuilder res = new StringBuilder();
var r = number % baselist.Length;
res.Append(baselist[r]);
int q = (int)Math.Floor((decimal)(number / baselist.Length));
@herman1vdb
herman1vdb / MinifyHtmlAttribute.cs
Last active May 7, 2020 07:22
Minify HTML with inline css/javascript for MVC C# as a ActionFilterAttribute
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using ZetaProducerHtmlCompressor.Internal;
namespace PmdWebsite.Helpers.ActionFilters