Skip to content

Instantly share code, notes, and snippets.

View jessgusclark's full-sized avatar

Jesse Clark jessgusclark

View GitHub Profile
@jessgusclark
jessgusclark / library-data-file.xml
Created April 14, 2016 17:09
library-data-file.pcf
<?xml version="1.0" encoding="utf-8"?>
<?pcf-stylesheet path="/xsl/data-file.xsl" title="Library Database" extension="html"?>
<!DOCTYPE document SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">
<document xmlns:ouc="http://omniupdate.com/XSL/Variables">
<ouc:info><tcf>section.tcf</tcf><tmpl>properties.tmpl</tmpl></ouc:info>
<page type="library-database"/>
<!-- Template that takes a URL and formats the content: -->
<xsl:template name="GetContentFromSingleDataFile">
<xsl:param name="data-url" />
<!-- Get the full path to the data file: -->
<xsl:variable name="full-path" select="concat($ou:root, $ou:site, $data-url)" />
<!-- Get Data File Content -->
<xsl:variable name="page-content" select="doc($full-path)/document" />
<!-- Template that takes a URL and formats the content: -->
<xsl:template name="GetContentFromSingleDataFile">
<xsl:param name="data-url" />
<!-- Get the full path to the data file: -->
<xsl:variable name="full-path" select="concat($ou:root, $ou:site, $data-url)" />
<!-- Get Data File Content -->
<xsl:variable name="page-content" select="doc($full-path)/document" />
@jessgusclark
jessgusclark / GetDataFilesWithTag.xsl
Last active March 10, 2017 23:32
Get All Files with the Tag of the page.
<xsl:template name="GetDataFilesWithTag">
<!-- Get the current file's path -->
<xsl:variable name="current-page"
select="concat('ou:/Tag/GetTags?', 'site=', $ou:site, '&amp;path=', replace($ou:path, '.html', '.pcf')" />
<!-- Get the first Tag that is associated with this subject listing page -->
<xsl:variable name="page-tag" select="doc( $current-page ) )/tags/tag[1]/name" />
<!-- Get Data Files With the Tag -->
@jessgusclark
jessgusclark / tag-loop.xsl
Last active April 14, 2016 15:10
Tag Management Demo
<xsl:variable name="page-path" select="replace($ou:path, '.html', '.pcf')" />
<xsl:for-each select="doc( concat('ou:/Tag/GetTags?', 'site=', $ou:site, '&amp;path=', $page-path ) )/tags/tag">
<li><xsl:value-of select="name" /></li>
</xsl:for-each>
@jessgusclark
jessgusclark / xsl-snippet.xsl
Created March 26, 2016 20:00
Remove JavaScript from OmniUpdate Pages
<xsl:template match="ouc:div/*/script|ouc:div/script">
<xsl:comment>Scripts in the content region have been disabled.</xsl:comment>
</xsl:template>
@jessgusclark
jessgusclark / int-loop-xslt.xslt
Last active February 8, 2016 22:55
Integer Loop in XSLT
<xsl:template name="main-template">
<xsl:call-template name="remaining-template-loop">
<xsl:with-param name="total" select="10"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="remaining-template-loop">
<xsl:param name="total" />
<xsl:param name="count" select="1" />
<xsl:if test="$count &lt; $total">
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var minifyCss = require('gulp-minify-css');
gulp.task('sass', function () {
gulp.src('./source/sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
@jessgusclark
jessgusclark / object.js
Created October 20, 2015 20:00
Convert Object to JSON
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using UNCWebcomm;
using System.Runtime.Serialization; //Add Reference to
@jessgusclark
jessgusclark / page.aspx
Created August 27, 2015 20:26
Nested Repeaters in C#
<%@ Import Namespace="System.Data" %>
---
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<h2><%# DataBinder.Eval(Container, "DataItem[\"FirstLetter\"]")%></h2>
<ul>
<asp:Repeater ID="Repeater2" runat="server"