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
using System.Collections.Generic; | |
using Examine; | |
using umbraco.businesslogic; | |
namespace MyApplication | |
{ | |
public class ExamineIndexRebuild : ApplicationStartupHandler | |
{ |
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 LinkRenderer | |
{ | |
public static string Transform(string richText) | |
{ | |
// take a rich text string, parse the local links | |
Regex ll = new Regex("(/{localLink:)(.*?)}"); | |
var linkRenderer = new LinkRenderer(); | |
MatchEvaluator myEvaluator = new MatchEvaluator(MatchLocalLinks); |
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
using System; | |
using System.Web.Caching; | |
namespace Puzzlebox.Caching | |
{ | |
interface ICacheService | |
{ | |
T Get<T>(string cacheId, Func<T> getItemCallback) where T : class; | |
T Get<T>(string cacheId, CacheDependency cacheDependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, Func<T> getItemCallback) where T : class; | |
} |
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
SET PORT=8086 | |
SET SOLUTIONNAME=VS.Solution.Filename.sln | |
SET WEBDIRECTORY=VS.Solution.Web.WorkingDirectory | |
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild %CD%\%SOLUTIONNAME% | |
start "IIS Express %PORT% (%SOLUTIONNAME%)" "%PROGRAMFILES%\IIS Express\iisexpress" /path:%CD%\%WEBDIRECTORY% /port:%PORT% | |
start "" "http://localhost:%PORT%/" |
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.Web.Mvc; | |
using System.Web.Routing; | |
using System.Web.WebPages; | |
namespace MyNamespace | |
{ | |
public enum DeviceType {Mobile, Desktop} | |
public class DeviceTypeRedirect : ActionFilterAttribute | |
{ |
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 googleDataEvents = { | |
pageTracker: null, | |
init: function (document) { | |
document.find("a[data-ga-label],area[data-ga-label]").click(this.trackLink); | |
}, | |
trackLink: function (e) { | |
if (_gaq) { | |
e.preventDefault(); | |
var l = $(this); | |
var label = l.attr("data-ga-label"); |
OlderNewer