Skip to content

Instantly share code, notes, and snippets.

@jhorsman
jhorsman / Auto shutdown task.xml
Created March 5, 2013 15:20
Windows Task Scheduler task to shutdown the server after specified hours of idle time. This file can be imported in Windows Task Scheduler.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2013-03-05T14:01:44.319601</Date>
<Author>TRAIN1\Administrator</Author>
<Description>Shut down the server after specified hours of idle time</Description>
</RegistrationInfo>
<Triggers>
<IdleTrigger>
<Enabled>true</Enabled>
/*
Resize a SDL Media Manager player.
By: Jan Horsman ([email protected])
The function setPlayerResizeEvent() performs the resize.
This solution is depending on JQuery which is loaded by the Media Manager
player anyway.
See the demo on http://jsfiddle.net/Jhorsman/4RN9C/
@jhorsman
jhorsman / mediamanager-endstate.html
Last active December 24, 2015 01:39
Use the endstate event on a SDL Media Manager Player. See this working on http://jsfiddle.net/Jhorsman/NtQrN/
<!DOCTYPE html>
<!--
Using
- HTML5 video player
- show-layer-endstate event
Example on http://jsfiddle.net/Jhorsman/NtQrN/
-->
<html>
<head>
@jhorsman
jhorsman / Restart-TridionServices.ps1
Last active April 1, 2016 15:23
SDL Tridion CM services restart, start and stop with PowerShell
Write-Host "Restarting all Tridion Services"
foreach ($svc in Get-Service)
{
if($svc.displayname.StartsWith("Tridion") -or $svc.displayname.StartsWith("SDL Web") -or $svc.displayname.StartsWith("SDL Delivery"))
{
if($svc.Status -eq "Running")
{
Write-Host " restarting"$svc.DisplayName
Restart-Service $svc.name -Force
} else {
@jhorsman
jhorsman / Add-AssemblyToGlobalAssemblyCache.ps1
Created October 21, 2013 12:27
Add-AssemblyToGlobalAssemblyCache.ps1 from http://blog.goverco.com/2012/04/use-powershell-to-put-your-assemblies.html. Usage example to deploy a DLL file to the GAC: ".\Add-AssemblyToGlobalAssemblyCache.ps1 -AssemblyName D:\Tridion\bin\Extentions\Tridion.Extensions.ContentManager.FunctionSources.dll"
<#
.SYNOPSIS
Installing Assemblies to Global Assembly Cache (GAC)
.DESCRIPTION
This script is an alternative to the GACUTIL available in
the .NET Framework SDK. It will put the specified assembly
in the GAC.
.EXAMPLE
.\Add-AssemblyToGlobalAssemblyCache.ps1 -AssemblyName C:\Temp\MyWorkflow.dll
@jhorsman
jhorsman / logback.xml
Last active March 19, 2018 13:16
SDL Tridion Content Delivery logging configuration.
<?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/user/log"/>
<property name="log.level" value="INFO"/>
<!-- Appenders -->
<appender name="rollingTransportLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
@jhorsman
jhorsman / Quatron-services-restart.ps1
Created October 22, 2013 14:10
SDL Quatron services restart, start and stop with PowerShell
Write-Host "Restarting running SDL Quatron Services"
foreach ($svc in Get-Service)
{
if($svc.displayname.StartsWith("SDL Quatron"))
{
if($svc.Status -eq "Running")
{
Write-Host " restarting"$svc.DisplayName
Restart-Service $svc.name -Force
@jhorsman
jhorsman / embed-code.html
Last active October 28, 2016 15:12
Media Manager AJAX embed code; example: http://codepen.io/jhorsman/pen/KgLRKV?editors=1010#0
<div id='71731aa0-ebaa-4e35-8b99-7c942dc3869f'></div>
<script type="text/javascript">
$.getScript('http://sdl-training.dist.sdlmedia.com/vms/distribution/embed/?o=2981B015-A171-4C6A-BEC6-9C0BC80B9F4E&trgt=71731aa0-ebaa-4e35-8b99-7c942dc3869f')
</script>
@jhorsman
jhorsman / workaround.html
Last active December 27, 2015 01:59
Player ready event bug and workaround. This bug is fixed in SDL Media Manager version 2.4 or earlier.
<!DOCTYPE html>
<html>
<head>
<!--<script src="jquery-2.0.3.min.js"></script>-->
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
$(document).ready(function() {
$("#myPlayer").bind("player-ready", event_playerready);
$(document).bind("MMPLAYERREADY", event_MMPLAYERREADY);
});
@jhorsman
jhorsman / play-pause-event.html
Created October 31, 2013 12:26
Media Manager play pause event
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
$(document).bind("MMPLAYERREADY", subscribePlayPauseEvent);
function subscribePlayPauseEvent() {
$("#myPlayer").find(".ppplay").first().click(trackVideoPlay);
$("#myPlayer").find(".pppause").first().click(trackVideoPause);