This file contains 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
void Application_End(object sender, EventArgs e) | |
{ | |
var reason = System.Web.Hosting.HostingEnvironment.ShutdownReason; | |
} |
This file contains 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
//update panel callback | |
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); | |
function EndRequestHandler(sender, args) | |
{ | |
//update panel finished updating | |
} |
This file contains 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 DebugTextWriter : System.IO.TextWriter | |
{ | |
public override void Write(char[] buffer, int index, int count) | |
{ | |
//output queries to "Output" window in visual studio | |
System.Diagnostics.Debug.Write(new String(buffer, index, count), "DBDebug"); | |
} | |
public override void Write(string value) | |
{ |
This file contains 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
var dtoItems = DataContext.Sources.Select(new Func<Source, SourceDTO>(s => { | |
var dto = new SourceDTO(); | |
s.Map(dto); | |
return dto; | |
})); |
This file contains 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
[PluginController("PasswordReset")] | |
public class ResetPasswordController : Umbraco.Web.Mvc.SurfaceController | |
{ | |
private MembershipProvider BackOfficeProvider | |
{ | |
get | |
{ | |
if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] == null) | |
{ | |
throw new InvalidOperationException("No membership provider found with name " + |
This file contains 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
/* This script deletes: | |
* 1. Oprhan data | |
* 2. All nodes from the trash | |
* 3. All previous node versions which are not publish or not newest unpublished | |
*/ | |
DECLARE @documentNodeObjectType uniqueidentifier = N'C66BA18E-EAF3-4CFF-8A22-41B16D66A972'; | |
DECLARE @trashPath varchar(5) = '%-20%'; | |
PRINT 'orphan data' |
This file contains 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
// Snippet of what needs added to the Fiddler2 script to add a fake CloudFront-Viewer-Country value on all requests. | |
// The "..."'s indicate hidden code to highlight what needs added. | |
// This is for testing locally. | |
class Handlers | |
{ | |
... | |
// Create CloudFront-Viewer-Country header setting in "Rules" main nav |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Web; | |
using AtlanticBT.Core.Logging; | |
using AtlanticBT.Core.Logging.Models; | |
using log4net.Appender; | |
using log4net.Core; |
This file contains 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
//Searches solution for all assemblies | |
public static class AppAssemblies | |
{ | |
public static IEnumerable<Assembly> AsEnumerable() | |
{ | |
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory; | |
foreach (Assembly assembly in Directory.GetFiles(baseDirectory) | |
.Where(x => Path.GetExtension(x).Equals(".dll", StringComparison.OrdinalIgnoreCase)) | |
.Select(Assembly.LoadFrom)) | |
{ |
This file contains 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
/// <summary> | |
/// DateTime for EST | |
/// </summary> | |
/// <returns>EST</returns> | |
public static DateTime LocalDateTime() | |
{ | |
var timeUtc = DateTime.UtcNow; | |
DateTime easternTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, EasternTimeZone()); | |
return easternTime; | |
} |
OlderNewer