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 partial class Elmah : DbMigration | |
{ | |
public override void Up() | |
{ | |
Sql(CreateTable_ELMAH_Error); | |
Sql(CreatreProcedure_ELMAH_GetErrorXml); | |
Sql(CreateProcedure_ELMAH_GetErrorsXml); | |
Sql(CreateProcedure_ELMAH_LogError); | |
} | |
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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="version.aspx.cs" Inherits="MyApplication.Version" %> | |
{"Version" : <asp:Literal runat="server" ID="Version"></asp:Literal>, "BuildDate" : <asp:Literal runat="server" ID="BuildDateString"></asp:Literal> } |
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 static class YouTubeUrl | |
{ | |
private const string UrlRegex = @"youtu(?:\.be|be\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)"; | |
public static string GetVideoId(string videoUrl) | |
{ | |
var regex = new Regex(UrlRegex); | |
var match = regex.Match(videoUrl); |
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
List View bound fields | |
<asp:BoundField DataField="Timestamp" HeaderText="Timestamp" ReadOnly="True" SortExpression="Timestamp" HtmlEncode="False" DataFormatString="<abbr class='timeago' title='{0:yyyy'-'MM'-'dd HH':'mm':'ss'Z'}'>{0}</abbr>" /> | |
In code: | |
DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ"); |
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 MyNamespace = MyNamespace || {}; | |
MyNamespace.UI = MyNamespace.UI || {}; | |
MyNamespace.UI.ModuleName = function ($, window) { | |
"use strict"; | |
var my = {}; | |
my.options = { |
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 static class ResourceFinder | |
{ | |
public static string Get(string resourceName) | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
var result = String.Empty; | |
using (var stream = assembly.GetManifestResourceStream(resourceName)) | |
{ | |
if (stream == null) |
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 static class FormatWith | |
{ | |
public static string FormatString(string format, object source) | |
{ | |
return FormatString(format, null, source); | |
} | |
public static string FormatString(string format, IFormatProvider provider, object source) | |
{ | |
if (format == null) |
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
if (typeof String.prototype.trim !== 'function') { | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}; | |
} |
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
; (function ($, window, document, undefined) { | |
// Create the defaults once | |
var __indexOf = | |
[].indexOf || function (item) { | |
for (var i = 0, l = this.length; i < l; i++) { | |
if (i in this && this[i] === item) return i; | |
} | |
return -1; | |
}; |
OlderNewer