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 storedVal = content.Aggregate<IPublishedContent, StringBuilder, string>( | |
new StringBuilder() | |
, (sb, x) => sb.Append(x.Id).Append((content.Last().Id==x.Id) ? "" : ",") | |
, (sb) => sb.ToString() | |
); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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> | |
/// Updates a querystring parameter with a new value | |
/// </summary> | |
/// <param name="req">The HTTPRequest object</param> | |
/// <param name="parameterName">The parameter name to update</param> | |
/// <param name="parameterValue">The new value for the parameter</param> | |
/// <returns></returns> | |
public static string UpdateQueryString(HttpRequest req, string parameterName, string parameterValue) | |
{ |
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> | |
/// Compares two comma delimited strings in order to find at least one matching element | |
/// </summary> | |
/// <param name="sourceElements">The first comma delimited string</param> | |
/// <param name="searchElements">The second comma delimited string</param> | |
/// <returns>True if there is at least one match</returns> | |
public static bool MatchesAtLeastOne(this string sourceElements, string searchElements) | |
{ | |
if (string.IsNullOrEmpty(sourceElements) || string.IsNullOrEmpty(searchElements)) return false; |
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
CREATE Function [dbo].[fn_ParseDelimitedStrings] | |
( | |
@String nvarchar(max), | |
@Delimiter char(1) | |
) | |
Returns @Values Table | |
( | |
RowId int Not Null Identity(1,1) Primary Key, | |
Value nvarchar(3000) Not 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
using System.Web; | |
using Umbraco.Web; | |
namespace DotSee.UmbracoExtensions | |
{ | |
/// <summary> | |
/// Helps with Umbraco content. | |
/// </summary> | |
public static class ContentHelper | |
{ |
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.Linq; | |
using System.Reflection; | |
using Umbraco.Core; | |
using Umbraco.Core.Logging; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
namespace DotSee.Common | |
{ | |
public class FixNodesWithoutTemplates : ApplicationEventHandler |
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.Linq; | |
using System.Text; | |
using System.Web; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
namespace DotSee.Common | |
{ | |
public static class ImageExtensions | |
{ |
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
DECLARE @DynamicColumns NVARCHAR(MAX); | |
DECLARE @DynamicSQL NVARCHAR(MAX); | |
SELECT @DynamicColumns = COALESCE(@DynamicColumns+', ', '')+QUOTENAME(languageISOCode) | |
FROM | |
( | |
SELECT DISTINCT | |
languageISOCode | |
FROM umbracolanguage | |
) AS FieldList; |
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; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
using Umbraco.Web.Models; | |
namespace DotSee.Common | |
{ | |
public static class ImageExtensions | |
{ |
OlderNewer