Skip to content

Instantly share code, notes, and snippets.

View jrnail23's full-sized avatar

James Nail jrnail23

View GitHub Profile
@jbevain
jbevain / MethodBaseRocks.cs
Created April 29, 2009 19:37
A reflection based disassembler
//
// MethodBaseRocks.cs
//
// Author:
// Jb Evain (jbevain@novell.com)
//
// WARNING: code now lives in http://github.com/jbevain/mono.reflection
//
// (C) 2009 Novell, Inc. (http://www.novell.com)
//
@rarous
rarous / gist:3529050
Created August 30, 2012 13:56
Generate MetaProj file from solution
$env:MSBuildEmitSolution=1
msbuild FooBar.sln /t:ValidateSolutionConfiguration
$env:MSBuildEmitSolution=0
@MattHoneycutt
MattHoneycutt / ModularConventionViewEngine.cs
Created May 2, 2013 02:09
A Razor view engine that supports several methods of organizing views and controllers within the same folder.
public class ModularConventionViewEngine : RazorViewEngine
{
//This needs to be initialized to the root namespace of your MVC project.
//Usually, the namespace of your Global.asax's codebehind will do the trick.
private static readonly string RootNamespace = typeof(MvcApplication).Namespace;
private static IEnumerable<string> GetPath(ControllerContext controllerContext, string viewName)
{
var paths = new List<string>();
@mhinze
mhinze / BaseController.cs
Created November 19, 2013 19:43
BaseController.cs with Async
using System.Threading.Tasks;
using System.Web.Mvc;
using JetBrains.Annotations;
using ShortBus;
public abstract class BaseController : Controller
{
public IMediator Mediator { get; set; }
protected Response<TResult> Query<TResult>(IQuery<TResult> query)
@offirgolan
offirgolan / extract-icu-message-argument-types.ts
Last active July 11, 2023 04:20
Extract ICU Message Argument Types
/**
* Utility type to replace a string with another.
*/
type Replace<S extends string, R extends string, W extends string> =
S extends `${infer BS}${R}${infer AS}`
? Replace<`${BS}${W}${AS}`, R, W>
: S
/**
* Utility type to remove all spaces and new lines from the provided string.