Skip to content

Instantly share code, notes, and snippets.

View Van-Dame's full-sized avatar

Anurag Mishra Van-Dame

  • New Delhi, India
View GitHub Profile
@Van-Dame
Van-Dame / MethodEnricher.cs
Created May 12, 2022 15:32 — forked from llaughlin/MethodEnricher.cs
Serilog - Log SourceMethod and SourceFile
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Serilog.Core;
using Serilog.Events;
namespace Logging.Enrichers
{
public class MethodEnricher : ILogEventEnricher
{
@Van-Dame
Van-Dame / 2019-https-localhost.md
Created June 14, 2020 19:08 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@Van-Dame
Van-Dame / cheatsheet.md
Created May 22, 2020 23:11 — forked from julekgwa/cheatsheet.md
Protractor API Cheatsheet with Examples
@Van-Dame
Van-Dame / README.md
Created September 25, 2017 11:27 — forked from lovasoa/README.md
Compute the intersection of large arrays in javascript

Array intersect

Fastest function to intersect a large number of big arrays in javascript, without dependencies

  • The compressed version is only 345 caracters long.
  • Faster than common libraries, even a large number of arrays, or on very big arrays. (See benchmarks)

Usage

@Van-Dame
Van-Dame / doskey.md
Created November 15, 2016 22:02 — forked from vladikoff/doskey.md
Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Saved from Archive.org, Date: May 14, 2010 Author: Jesse Webb

http://web.archive.org/web/20140330024520/http://devblog.point2.com/2010/05/14/setup-persistent-aliases-macros-in-windows-command-prompt-cmd-exe-using-doskey/

Our development machines here at Point2 are not standardized; we have a mixture of Windows XP, 7, and Mac OSX/Unix computers. I find myself constantly switching back and forth between command prompt interfaces when pair programming. As a result, I catch myself using “ls” to list a directories contents regardless of what system I am on. I am currently using a Windows XP machine for my developer box and I wanted to setup an alias to the “ls” command to actually perform a “dir”. Here is how I accomplished it…

There is a command available in a Window’s shell that let’s you “alias” command to whatever you please: DOSKey. It allows you to create “macros” to execute one or more other commands with a custom nam

@Van-Dame
Van-Dame / SitemapGenerator.cs
Created August 20, 2016 08:29 — forked from jordanwallwork/SitemapGenerator.cs
dotnet core mvc sitemap generator
// Modified code from http://dotnetthoughts.net/generate-dynamic-xml-sitemaps-in-aspnet5/
public static class SitemapGenerator
{
private static string _sitemapContent = null;
public static string Generate(string rootUrl, IUrlHelper urlHelper)
{
if (_sitemapContent == null) // I only wanted to generate this once and then stash the result. Caching the action that calls this would probably be better
{
string sitemapContent = "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
@Van-Dame
Van-Dame / C#-hash-generator.cs
Last active September 21, 2018 06:56 — forked from rmacfie/C# hash generator
Generate Md5 and SHA hashes in C#.NET.
public static class CryptographyExtensions
{
/// <summary>
/// Calculates the MD5 hash for the given string.
/// </summary>
/// <returns>A 32 char long MD5 hash.</returns>
public static string GetHashMd5(this string input)
{
return ComputeHash(input, new MD5CryptoServiceProvider());
}