- Install Ps-Get:
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
- Install posh-git:
Install-Module posh-git
- Edit or create
%userprofile%/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1:
| // Workaround for Postal.MVC5 1.2.0 issue 73 | |
| // https://github.com/andrewdavey/postal/issues/73 | |
| if (HttpContext.Current == null) | |
| { | |
| var baseURL = ConfigurationManager.AppSettings["baseURL"].TrimEnd('/'); | |
| var absolute = VirtualPathUtility.ToAbsolute("~/").TrimStart('/'); | |
| HttpContext.Current = new HttpContext( | |
| new HttpRequest("", baseURL + "/" + absolute, ""), | |
| new HttpResponse(new StringWriter()) |
| using System; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Web.Http.Controllers; | |
| using System.Web.Http.ValueProviders; | |
| public class MultipartFormDataValueProvider : IValueProvider | |
| { |
| using System.Collections.Generic; | |
| using System.Text.RegularExpressions; | |
| namespace Your.Web.Project | |
| { | |
| public static class FilterHelper | |
| { | |
| public static bool HasOption(string query, string option) | |
| { | |
| var regex = GetRegex(option); |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace Your.Project.Helpers | |
| { |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web.Mvc; | |
| using System.Web.WebPages; | |
| public static class IsomorphicRazorExtensions | |
| { | |
| public static HelperResult Foreach<T>(this HtmlHelper helper, IEnumerable<T> items, Func<T, HelperResult> template) | |
| where T : class, new() |
| function global:Set-AppPoolEnvVariable { | |
| param ( | |
| [string]$appPool = $(Read-Host "Application Pool"), | |
| [string]$varName = $(Read-Host "Variable name"), | |
| [string]$varValue = $(Read-Host "Variable value") | |
| ) | |
| $sec = "System.Security.Principal"; | |
| $acct = New-Object "$sec.NTAccount" -ArgumentList "IIS AppPool\$appPool"; | |
| $sid = $acct.Translate([System.Type]::GetType("$sec.SecurityIdentifier")).Value; | |
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Install-Module posh-git
%userprofile%/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1:Handles 401 errors for OAuth users following the 'code flow' (redirects) and notifies the user if there is a fatal error. You wouldn't want the server giving your users 401s outright though -- only when the request is AJAX (X-Requested-With: XMLHttpRequest.)
Uses jQuery (obviously) as well as Bootstrap modals. I'm not using PJAX just yet but I will include it when I do.
In the following example, I've placed the following elements as the last children of the <body> element. Note the addition of the empty data-remote attribute on #dynamic-modal -- this prevents Bootstrap from performing a redundant load the first time the modal is used.
<div class="modal fade special" id="error-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">For every application I have worked on, CQRS has not made sense, nor have commands/handlers. This Gist is here so I can compile a large quantity of relevant articles regarding those patterns and practices, and ideally come back to write about the topic from a "YAGNI" perspective.
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace Microsoft.AspNetCore.Builder | |
| { | |
| public static class WebApplicationBackgroundTaskExtensions |