Skip to content

Instantly share code, notes, and snippets.

View sionjlewis's full-sized avatar

Siôn J. Lewis sionjlewis

View GitHub Profile
@sionjlewis
sionjlewis / XSL-JSRenderTrap.xsl
Created June 24, 2015 14:28
Client-side Development Techniques with CQWP(s) and JavaScript - Part 4/5
<label id="lblExample-{{{{attr:ID}}}}" title="{{{{attr:Product}}}}">{{:Product}}</label>
@sionjlewis
sionjlewis / CQWP-UseCache.xsl
Created June 24, 2015 14:30
Client-side Development Techniques with CQWP(s) and JavaScript - Part 5/5
<property name="UseCache" type="bool">False</property>
@sionjlewis
sionjlewis / SpecRunner.cshtml
Created June 24, 2015 15:49
Added a SpecRunner View
<link rel="shortcut icon" type="image/png" href="/Content/jasmine/jasmine_favicon.png">
@Styles.Render("~/Content/jasmine/jasmine.css")
@Scripts.Render("~/Scripts/jasmine/jasmine.js")
@Scripts.Render("~/Scripts/jasmine/jasmine-html.js")
@Scripts.Render("~/Scripts/jasmine/boot.js")
@Scripts.Render("~/Scripts/jquery-1.10.2.js")
@Scripts.Render("~/Scripts/knockout-3.2.0.debug.js")
@Scripts.Render("~/Scripts/jasmine/jasmine.js")
@sionjlewis
sionjlewis / VideoPlayer.js
Last active August 29, 2015 14:27
Example of how to embedding a video within a Script Editor Webpart (SharePoint Online), using the Office 365 Video Portal REST API
var PlayVideo = function (chid, vid) {
var rootURL = window.location.protocol + "//" + window.location.host;
var siteURL = rootURL + '/portals/hub'
var wsPath = '/_api/VideoService/Channels(guid\'' + chid + '\')/Videos(guid\'' + vid + '\')?$Select=Title,Description,CreatedDate,DefaultEmbedCode,VideoDurationInSeconds,ID,VideoProcessingStatus,ThumbnailUrl';
var followAPI = siteURL + wsPath;
var getVideo = function () {
jQuery.ajax({
url: followAPI,
headers: {
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Unit Test Method</Title>
<Author>Siôn J. Lewis</Author>
<Description>Adds a unit test method with comments based on the AAA (Arrange,Act,Assert) pattern</Description>
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl>
<Shortcut>utest</Shortcut>
<SnippetTypes>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Unit Test Async Method</Title>
<Author>Siôn J. Lewis</Author>
<Description>Adds an async unit test method with comments based on the AAA (Arrange,Act,Assert) pattern</Description>
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl>
<Shortcut>utestasync</Shortcut>
<SnippetTypes>
@sionjlewis
sionjlewis / HAW01.package.jason.parshall.js
Last active January 8, 2017 12:58
Hello Angular World: code snippet for article (http://www.sjlewis.com). The complete source code and project files can be found here: https://github.com/sionjlewis/Hello.Angular.World
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lint": "tslint ./app/**/*.ts -t verbose",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
@sionjlewis
sionjlewis / HAW16.Global.asax.parshall.cs
Last active January 8, 2017 13:04
Hello Angular World: code snippet for article (http://www.sjlewis.com). The complete source code and project files can be found here: https://github.com/sionjlewis/Hello.Angular.World
BundleConfig.RegisterBundles(BundleTable.Bundles);
@sionjlewis
sionjlewis / HAW15.BundleConfig.cs
Last active January 8, 2017 13:04
Hello Angular World: code snippet for article (http://www.sjlewis.com). The complete source code and project files can be found here: https://github.com/sionjlewis/Hello.Angular.World
using System.Web;
using System.Web.Optimization;
namespace My.iTunes.Client.App_Start
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
@sionjlewis
sionjlewis / HAW14.Views.Web.config.parshall.xml
Last active January 8, 2017 13:04
Hello Angular World: code snippet for article (http://www.sjlewis.com). The complete source code and project files can be found here: https://github.com/sionjlewis/Hello.Angular.World
<!-- Added to implement bundling -->
<add namespace="System.Web.Optimization" />