This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using log4net; | |
namespace BasilBee.Infrastructure.Logging { | |
public class LoggingService : ILoggingService | |
{ | |
// ReSharper disable InconsistentNaming | |
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
// ReSharper restore InconsistentNaming |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IHtmlString Resource(this HtmlHelper htmlHelper, Func<object, dynamic> template, string type) | |
{ | |
if (htmlHelper.ViewContext.HttpContext.Items[type] != null) ((List<Func<object, dynamic>>)htmlHelper.ViewContext.HttpContext.Items[type]).Add(template); | |
else htmlHelper.ViewContext.HttpContext.Items[type] = new List<Func<object, dynamic>>() { template }; | |
return new HtmlString(String.Empty); | |
} | |
public static IHtmlString RenderResources(this HtmlHelper htmlHelper, string type) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//at the top of _Layout.cshtml | |
@RenderSection("Styles",false) | |
@Html.RenderResources(ResourceType.Css) | |
//at the bottom of _Layout.cshtml | |
@RenderSection("Scripts",false) | |
@Html.RenderResources(ResourceType.Js) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//for style sheets | |
@Html.Resource(@<link href="@Url.Content("~/Content/productSummary.css")" rel="stylesheet" />, ResourceType.Css) | |
//for script files | |
@Html.Resource(@<script src="@Url.Content("~/js/productSummary.js")" type="text/javascript" ></script>, ResourceType.Js) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ResourceType | |
{ | |
public const string Css = "css"; | |
public const string Js = "js"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cinst msysgit | |
cinst git | |
cinst poshgit | |
cinst git-flow-dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clone git flow to appropriate directory | |
> git clone --recursive git://github.com/nvie/gitflow.git | |
# change directory to gitflow | |
> cd gitflow | |
# Run the msysgit-install script with the location as a parameter. | |
> contrib\msysgit-install.cmd "C:\Users\USER_NAME\AppData\Local\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7" | |
# Note: Replace PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7 with the name of your directory; you do not need the \bin at the end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
static void Main(string[] args) | |
{ | |
CommandArgumentCollection argumentCollection = new CommandArgumentCollection(args); | |
if (argumentCollection.GetFirstArgument("console") != null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomMemoryAppender : AppenderSkeleton | |
{ | |
private readonly StringBuilder logBuffer; | |
readonly StringWriter stringWriter; | |
private readonly object lockObject = new object(); | |
public CustomMemoryAppender() | |
{ | |
logBuffer = new StringBuilder(); | |
stringWriter = new StringWriter(logBuffer); |
OlderNewer