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 CustomHandleErrorAttribute : HandleErrorAttribute | |
| { | |
| private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
| public override void OnException(ExceptionContext filterContext) | |
| { | |
| if (!filterContext.HttpContext.IsCustomErrorEnabled) | |
| { | |
| return; | |
| } |
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
| /** | |
| * WkHtmlToPdf table splitting hack. | |
| * | |
| * Script to automatically split multiple-pages-spanning HTML tables for PDF | |
| * generation using webkit. | |
| * | |
| * To use, you must adjust pdfPage object's contents to reflect your PDF's | |
| * page format. | |
| * The tables you want to be automatically splitted when the page ends must | |
| * have a class name of "splitForPrint" (can be changed). |
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
| protected void Application_Error(Object sender, EventArgs e) | |
| { | |
| var httpContext = ((MvcApplication)sender).Context; | |
| var currentRouteData = RouteTable.Routes.GetRouteData(new HttpContextWrapper(httpContext)); | |
| var currentController = " "; | |
| var currentAction = " "; | |
| if (currentRouteData != 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
| param($installPath, $toolsPath, $package, $project) | |
| $projectItems = $project.ProjectItems | |
| $isWPFProject = Select-String -Simple "{60DC8134-EBA5-43B8-BCC9-BB4BC16C2548}" $project.FullName #WPF project guid | |
| $isWinFormsProject = Select-String -Simple "FlavorProperties" $project.FullName #WinForms project doesn't support FlavorProperties so should be empty | |
| if(([string]::IsNullOrEmpty($isWPFProject) -eq $false) -or ([string]::IsNullOrEmpty($isWinFormsProject) -eq $true)) { | |
| #terminal app project | |
| Write-Host "Detected terminal application project (WebForms or WPF)" | |
| $projectItems.Item("log4net.config").Delete() |
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 NotifyPropertyBase : INotifyPropertyChanged | |
| { | |
| public event PropertyChangedEventHandler PropertyChanged; | |
| protected virtual void OnPropertyChanged( Expression<Func<object>> propertyExpression ) | |
| { | |
| PropertyChangedEventHandler handler = PropertyChanged; | |
| if (handler != null) handler( this, new PropertyChangedEventArgs( GetPropertyName( propertyExpression ) ) ); | |
| } | |
| private string GetPropertyName( Expression<Func<object>> propertyExpression ) |
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
| (function ($) { | |
| 'use strict'; | |
| $.debounce = function (delay, fn) { | |
| var timer = null; | |
| return function () { | |
| var context = this, args = arguments; | |
| clearTimeout(timer); | |
| timer = setTimeout(function () { | |
| fn.apply(context, args); | |
| }, delay); |
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
| param($installPath, $toolsPath, $package, $project) | |
| $projectFullName = $project.FullName | |
| Write-Host "Copying Docs folder to the root of the solution: $projectFullName" | |
| $fileInfo = new-object -typename System.IO.FileInfo -ArgumentList $projectFullName | |
| $projectDirectory = $fileInfo.DirectoryName | |
| $sourceDirectory = "$installPath\docs" | |
| Write-Host $sourceDirectory |
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
| // taken from: https://github.com/bradwilson/ndc2012/tree/master/NdcDemo | |
| public abstract class ApiControllerWithHub<THub> : ApiController | |
| where THub : IHub | |
| { | |
| private readonly Lazy<IHubContext> _hub = new Lazy<IHubContext>( | |
| () => GlobalHost.ConnectionManager.GetHubContext<THub>() | |
| ); | |
| protected IHubContext Hub |
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
| Register-TabExpansion 'Get-SolutionPackages' @{ | |
| 'PackageName' = { Get-Package | Sort-Object -Property Id -Unique | foreach { $_.Id } } | |
| } | |
| function Get-SolutionPackages($PackageName) { | |
| $nl = [Environment]::NewLine | |
| $packageSummaryList = @() | |
| Get-Project -All | ForEach-Object { |
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
| (function() { | |
| d3.force_labels = function force_labels() { | |
| var labels = d3.layout.force(); | |
| // Update the position of the anchor based on the center of bounding box | |
| function updateAnchor() { | |
| if (!labels.selection) return; | |
| labels.selection.each(function(d) { | |
| var bbox = this.getBBox(), | |
| x = bbox.x + bbox.width / 2, |