Skip to content

Instantly share code, notes, and snippets.

@csim
csim / RapidCachedDataAdapterBase.cs
Last active August 29, 2015 13:58
SharePoint Content Database as a Cache
public abstract class RapidCachedDataAdapterBase<TData>
where TData : class
{
protected Guid SiteID;
protected virtual bool AutoRefreshCache;
protected virtual string CacheKey;
protected virtual string CacheExpireKey;
protected virtual int CacheTimeoutMinutes;
public virtual TData CachedData;
@csim
csim / embed.html
Created April 9, 2014 15:28
SharePoint Video Embed
<object id="video" type="application/x-silverlight-2"
data="data:application/x-silverlight-2," width="100%" height="100%">
<param name="source" value="/_layouts/clientbin/mediaplayer.xap" />
<param name="enableHtmlAccess" value="true" />
<param name="windowless" value="true" />
<param name="background" value="#80808080" />
<param name="initParams"
value="mediaTitle=,mediaSource={VIDEO URL},previewImageSource={VIDEO PREVIEW IMAGE},autoPlay=true" />
<param name="onresize" value="video" />
<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
@csim
csim / web.config.xml
Last active August 29, 2015 13:58
Sharepoint HttpModule
<?xml version="1.0" encoding="utf-8" ?>
<actions>
<add path="configuration/system.web/httpModules"
id="{8DD2A7B1-0223-4be8-B1B5-339B642EFB21}">
<add name="MyHttpModule"
type="MyHttpModule, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a1df43608d33992f" />
</add>
</actions>
@csim
csim / BaseFieldControl.cs
Last active August 29, 2015 13:58
SharePoint Field Control
namespace MyProject.Web.UI.FieldControls
{
using System;
using System.Web.UI;
using Microsoft.SharePoint.WebControls;
public abstract class UserControlFieldBase : BaseFieldControl
{
private SPFieldUserControlBase _usercontrol;
@csim
csim / index.html
Last active December 27, 2015 15:09
<a name="{{ post.url }}"></a>
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
<div class="post-date">{{ post.date | date: "%-d %B %Y" }}</div>
{{ post.content }}
<div class="post-separator"></div>