Skip to content

Instantly share code, notes, and snippets.

View netsi1964's full-sized avatar

Sten Hougaard netsi1964

View GitHub Profile
@netsi1964
netsi1964 / DynamicwebCMSsqlScripts.sql
Last active March 14, 2016 13:23
Dynamicweb CMS sql scripts
-- Dynamicweb CMS sql scripts
-- By Sten Hougaard, netsi1964@gmail.com
FOR XML AUTO
-- Opdateret
---------------------------------------------------------e------------------------------
-- Accessuser/page
---------------------------------------------------------------------------------------
-- Find pages modified by non-admins on given areaid
@netsi1964
netsi1964 / jsSnippets.js
Created May 14, 2012 06:05
javascript snippets
function toXPath(s) {
s = s.replace(/[<>]/ig, '');
var iAtt = s.indexOf(' ');
var aAtt = s.substring(iAtt+1).split(' ');
var sTag = s.substr(0, iAtt);
for(var i=0; i<aAtt.length; i++) {
aAtt[i] = '@'+aAtt[i].replace(/"/ig, '\'')+((i!=aAtt.length-1) ? ' ' : '');
};
var a = '';
for(var i=0; i<aAtt.length;i++) {
@netsi1964
netsi1964 / xslt-entities.xslt
Created May 16, 2012 11:49
XSLT - entities example
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY netsi "netsi1964@gmail.com">]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="no"/>
<xsl:template match="/">
<h1>&amp;netsi; bliver til "&netsi;"</h1>
@netsi1964
netsi1964 / variousVIASnippets.xslt
Created June 6, 2012 14:18
VARIOUS VIA XSLT SNIPPETS
<?xml version="1.0" encoding="utf-8"?>
<!-- https://gist.github.com/raw/2882142/02058e354cc9eb8d283b57147d6c1b6aadac7fb7/variousVIASnippets.xslt -->
<!-- VARIOUS VIA XSLT SNIPPETS -->
<!-- Sten Hougaard, netsi1964@gmail.com - 2012-06-06 -->
<!-- On module snippets -->
<xsl:key name="QueryString" match="//RequestContent/QueryString/Entry" use="@Name"/>
<xsl:key name="request" match="//RequestContent/ServerVariables/Entry" use="@Name"/>
<!-- On page snippets -->
@netsi1964
netsi1964 / Netsi1964HTMLSnippets.html
Created June 12, 2012 08:32
Netsi1964 HTML SNIPPETS
Netsi1964 HTML SNIPPETS
<!-- Simpel default/placeholder value for textarea, require jQuery -->
<textarea name="" id="" cols="30" rows="10" placeholder="test">test</textarea>
<script type="text/javascript">
$(function() {
var test = document.createElement('textarea');
if (!!!('placeholder' in test)) {
jQuery('textarea').focus(function() {
var $this = $(this);
if ($.trim($this.val())===$this.attr('placeholder')) {
@netsi1964
netsi1964 / css3-quote.html
Created June 22, 2012 12:50
Playing around with CSS3- building a quote feature
<html>
<head>
<title>Playing around with CSS3- building a quote feature</title>
<meta charset="utf-8" />
<style type="text/css">
.quote {
background-color: rgba(0, 0, 0, 0.1);
font-size: 140%;
margin: 13px;
padding: 15px;
@netsi1964
netsi1964 / Dynamicweb XSLT Translate method.xslt
Created June 24, 2012 20:41
Dynamicweb XSLT Translate method
<xsl:variable name="translationfile" select="document(concat('http://',/Template/GlobalTags/Global.Request.Host,'/Files/Templates/Translations.xml'))" />
<xsl:variable name="currentlanguage" select="/Template/GlobalTags/Global.Area.LongLang" />
<xsl:template name="translate">
<xsl:param name="translationkey" />
<xsl:param name="defaulttranslation" />
<xsl:choose>
<xsl:when test="$translationfile/translations/key[@name=$translationkey]"><xsl:value-of select="$translationfile/translations/key[@name=$translationkey]/translation[@culture=string($currentlanguage)]" /></xsl:when>
<xsl:otherwise><xsl:value-of select="$defaulttranslation" /></xsl:otherwise>
@netsi1964
netsi1964 / boilerplateCSSMediaQueries.css
Created June 24, 2012 21:58
Boilerplate CSS Media Queries
/**********************************************************/
/* Boilerplate CSS Media Queries */
/* http://www.paulund.co.uk/boilerplate-css-media-queries */
/* boilerplateCSSMediaQueries.css */
/**********************************************************/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-width : 320px)
and (max-width : 480px) {
@netsi1964
netsi1964 / DW:findColumnsInTable.sql
Created June 27, 2012 11:10
Dynamicweb: Find columns in table
SELECT [name] AS [Column Name]
FROM syscolumns
WHERE id = (SELECT id FROM sysobjects WHERE [Name] = 'page')
AccessUserID
AccessUserParentID
AccessUserUserName
AccessUserPassword
AccessUserName
AccessUserDepartment
@netsi1964
netsi1964 / lesson01.html
Created July 2, 2012 22:12
angular: Getting started
<!doctype html>
<html ng-app>
<head>
<meta charset="utf-8" />
<script src="http://code.angularjs.org/angular-1.0.1.min.js"></script>
<script type="text/javascript">
var BorderRadius = function($scope) {
$scope.borders = [
{'value':'top'},
{'value':'right'},