Skip to content

Instantly share code, notes, and snippets.

View romansp's full-sized avatar

Raman Paulau romansp

View GitHub Profile
@zhengchun
zhengchun / DisableFormValueModelBinding.cs
Created March 22, 2019 01:59
ASP.NET fast upload file to AWS using multipart/form-data without take memory
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class DisableFormValueModelBindingAttribute : Attribute, IResourceFilter
{
public void OnResourceExecuting(ResourceExecutingContext context)
{
var factories = context.ValueProviderFactories;
factories.RemoveType<FormValueProviderFactory>();
factories.RemoveType<JQueryFormValueProviderFactory>();
}
@jessfraz
jessfraz / boxstarter.ps1
Last active June 23, 2025 13:25
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@jchandra74
jchandra74 / openssl.MD
Last active March 17, 2025 15:25
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@ameerkat
ameerkat / MD5.cs
Created October 29, 2016 08:35
MD5 Implementation in C# based on Wikipedia psuedocode
using System;
using System.Linq;
namespace MD5
{
/// <summary>
/// RFC for MD5 https://tools.ietf.org/html/rfc1321
/// Based on the pseudo code from Wikipedia: https://en.wikipedia.org/wiki/MD5
/// </summary>
public class MD5
@NickCraver
NickCraver / DmpAnalysis.linq
Last active May 1, 2024 21:09
DMP Analysis in LinqPad
<Query Kind="Program">
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference>
<Namespace>Microsoft.Diagnostics.Runtime</Namespace>
<Namespace>System</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace>
</Query>
@daniel-chambers
daniel-chambers / AadExtensions.cs
Last active May 29, 2018 04:10
Get All Users in AppRole in Azure Active Directory
public static class AadExtensions
{
public static async Task<IEnumerable<IUser>> GetAllUsersInAppRoleAsync(
this IActiveDirectoryClient client,
string servicePrincipalObjectId,
string appRoleId)
{
var guidAppRoleId = Guid.Parse(appRoleId);
var appRoleAssignmentsPaged = await client.ServicePrincipals
.GetByObjectId(servicePrincipalObjectId)
@davidfowl
davidfowl / dotnetlayout.md
Last active July 26, 2025 08:24
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/