Skip to content

Instantly share code, notes, and snippets.

Merritt Melker MerrittMelker

Block or report user

Report or block MerrittMelker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MerrittMelker
MerrittMelker / sample 1
Created Sep 8, 2016
editing umbraco content from database
View sample 1
/****** Script for SelectTopNRows command from SSMS ******/
begin tran
declare @start bigint, @end bigint
--STUFF ([xml],
SELECT
@start = PATINDEX('%calendarLink"%', [xml]),
@end = PATINDEX('%}%', Substring([xml], PATINDEX('%calendarLink%', [xml]), datalength([xml])))
FROM [cmsContentXml] where nodeId = 1098
select substring([xml], @start + 14, @end) from cmsContentXml where nodeid = 1098
@MerrittMelker
MerrittMelker / Hackish Way To Make ItemViewModel Work with RelatedItems
Last active Jul 23, 2016
Example Hooking Up Related Items To List of Dynamic Content to Create Functional ItemViewModels
View Hackish Way To Make ItemViewModel Work with RelatedItems
private List<ItemViewModel> GetSponsorViewModels()
{
var sponsorGuids = JsonSerializer.DeserializeFromString<IList<Guid>>(SelectedSponsorIds);
var type = TypeResolutionService.ResolveType(SponsorType);
var sponsorDataItems = DynamicModuleManager.GetManager().GetDataItems(type).Where(x => x.Status == ContentLifecycleStatus.Live && x.Visible && sponsorGuids.Contains(x.Id));
var sponsorViewModels = new List<ItemViewModel>();
foreach (var spi in sponsorDataItems)
{
spi.GetRelatedItems<Image>("Image");
sponsorViewModels.Add(new ItemViewModel(spi));
@MerrittMelker
MerrittMelker / bar.cs
Last active Oct 8, 2015
superpus potential example
View bar.cs
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tribune
{
public abstract class Tribune
@MerrittMelker
MerrittMelker / ProductionEventManager.cs
Created Aug 24, 2015
example of fluent api for publishing and unpublishing page
View ProductionEventManager.cs
using System.Collections.Generic;
using System.Linq;
using Ks.Sf.Modules.Dynamic;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Data.Events;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.DynamicModules.Events;
using Telerik.Sitefinity.DynamicModules.Model;
using Telerik.Sitefinity.GenericContent.Model;
using Telerik.Sitefinity.Model;
@MerrittMelker
MerrittMelker / Default.cshtml
Created Aug 13, 2015
Example of Sitefinity Feather Navigation Custom widget
View Default.cshtml
@model Ks.Sf.Web.Model.OpaHeaderController.OpaHeaderView
@using Telerik.Sitefinity.Services;
@using Telerik.Sitefinity.Modules.Pages;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Ks.Sf.Web.Mvc.Controllers;
@using ServiceStack
@using Telerik.Sitefinity.Frontend.Navigation.Mvc.Models
@{
@MerrittMelker
MerrittMelker / AssembyInfo.cs
Created Aug 6, 2015
Login Service For Sitefinity Example
View AssembyInfo.cs
using System.Reflection;
using System.Runtime.InteropServices;
using System.Web;
using Ks.Sf.Web.Bootstrap;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.Attributes;
[assembly: ControllerContainer]
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
View CustomMembershipProvider 4 Sitefinity
using System;
using System.Linq;
using Ks.Sf.Web;
using Ks.Tessitura;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.Security.Claims;
using Telerik.Sitefinity.Security.Data;
using Telerik.Sitefinity.Security.Model;
namespace SitefinityWebApp.Providers
View Async Inside Sync Actions
public ActionResult Sync1()
{
using (var soapClient = MySoapClient())
{
var task = soapClient.Method1Async().ConfigureAwait(false);
ViewBag.Result = task.GetAwaiter().GetResult();
}
return View();
}
@MerrittMelker
MerrittMelker / controller
Created Jul 19, 2015
Example Backend Widget
View controller
using System.Web.Mvc;
using Telerik.Sitefinity.Mvc;
namespace Ks.Sf.Web.Mvc.Controllers
{
[ControllerToolboxItem(Name = "TestDataLoader_MVC", Title = "Test Data Loader",
SectionName = "Dashboard", CssClass = "sfListitemsIcn sfMvcIcn")]
public class TestDataLoaderController : Controller
{
public ViewResult Index()
@MerrittMelker
MerrittMelker / Current Solution
Last active Aug 29, 2015
Problem with joining
View Current Solution
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Linq.Expressions;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Ks.Sf.Config;
You can’t perform that action at this time.