Skip to content

Instantly share code, notes, and snippets.

@jhorsman
jhorsman / jQuery example.html
Created December 5, 2013 08:18
Hello World! In jQuery
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</script>
<script>
$(document).ready(function(){
$("#label").text("Hello world!");
});
</script>
@jhorsman
jhorsman / hello world bookmarklet.js
Last active December 30, 2015 08:19
Bookmarklet example. Add this bookmarklet to the location field of a new bookmark.
javascript:(function(){alert("Hello, World!");}());
@jhorsman
jhorsman / tagging
Last active January 2, 2016 02:39
Description about example XYZ #example #tagging
Gist can do tagging after all... Just search for @username and #tagname
I.e. https://gist.github.com/search?q=%40jhorsman+%23tagging
@jhorsman
jhorsman / SmartTarget_tag_demo.jsp
Last active January 2, 2016 21:29
SDL SmartTarget 2011 SP2 tag demo of variables in the promtion query in a SDL SmartTarget enabled page. This is JSP code, there is a similar user control for ASP .NET. SDL SmartTarget 2011 SP2.
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page language="java"%>
<%@ page import="java.net.URI" %>
<%@ page import="com.tridion.ambientdata.claimstore.ClaimStore" %>
<%@ page import="com.tridion.ambientdata.AmbientDataContext" %>
<%@ taglib uri="smarttarget" prefix="smarttarget" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@jhorsman
jhorsman / presentation server logback config example.xml
Last active January 3, 2016 05:59
SDL Tridion 2013 SP1 Content Delivery Logback configuration example from installation media. This is the part of the logback.xml which you would effectively use on a presentation server. The following loggers are removed from this example: rollingTransportLog, rollingDeployerLog, rollingMonitorLog, rollingSessionPreviewLog
<appender name="rollingContextLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.folder}/cd_context.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>${log.history}</maxHistory>
</rollingPolicy>
<encoder>
<charset>${log.encoding}</charset>
<pattern>${log.pattern}</pattern>
</encoder>
<prudent>true</prudent>
@jhorsman
jhorsman / SmartTarget logback config example.xml
Created January 14, 2014 15:42
SDL Tridion 2011/2013 CD logback configuration example for SmartTarget. I use this to troubleshoot SmartTarget on the development presentation server. Deploy this example as logback.xml on the web server.
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- Properties -->
<property name="log.pattern" value="%date %-5level %logger{0} - %message%n"/>
<property name="log.history" value="7"/>
<property name="log.folder" value="/home/tnwin/tnsmart/log"/>
<property name="log.level" value="INFO"/>
<!-- Appenders -->
@jhorsman
jhorsman / SmartTarget logback example.xml
Created January 14, 2014 16:14
SDL SmartTarget 2011 SP3 Content Delivery Logback configuration example. From SmartTarget installation media.
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<!-- Properties -->
<property name="log.pattern" value="%date %-5level %logger{0} - %message%n"/>
<property name="log.history" value="7"/>
<property name="log.folder" value="c:/tridion/log"/>
<property name="log.level" value="WARN"/>
<!-- Appenders -->
<appender name="rollingSmartTargetLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
@jhorsman
jhorsman / postbuild.bat
Created January 14, 2014 16:24
Restarting SDL Tridion 2011/2013 services while developing an Event system. You can use this batchfile as a post build task in Visual Studio.
@echo off
@echo Stopping Tridion Services
REM stopping the services with 'net stop' instead of 'sc stop' (this is synchronous)
net stop TCMPublisher
net stop TcmSearchIndexer
net stop TcmServiceHost
@echo Stopping Tridion Com+ application
cscript "..\..\..\Stop ComPlus.vbs"
@jhorsman
jhorsman / depth.cs
Last active January 3, 2016 08:29
Fiddling with Tridion CD Taxonomies...
mytax.TaxonomyFilter =
new DepthFilter(DepthFilter.UnlimitedDepth, DepthFilter.FilterDown);
@jhorsman
jhorsman / verifyDotNetVersion.ps1
Created January 16, 2014 12:48
Verify which .NET Frameworks are installed through a PowerShell command. This works for .NET 4.5.1 as well, unlike many other comparable scripts. Copied from http://stackoverflow.com/a/3495491/1678525
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version