Skip to content

Instantly share code, notes, and snippets.

@kensykora
kensykora / validate-site-html.ps1
Created May 28, 2014 14:38
W3C HTML Sitemap-based Site Validator
param ([Parameter(Mandatory=$True)][string]$SitemapUrl,
[int]$Max=0)
function Validate($url) {
if(-not $url.StartsWith("http")) {
$parsed = [System.Uri]$SitemapUrl
$url = "{0}://{1}{2}" -f $parsed.Scheme, $parsed.Host, $url
}
@kensykora
kensykora / transform-all.bat
Last active December 31, 2020 16:58
Pre-Build event for T4 Transformation
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
:: set the working dir (default to current dir)
set wdir=%cd%
if not (%1)==() set wdir=%1
echo executing transform_all from %wdir%
:: create a list of all the T4 templates in the working dir
dir %wdir%\*.tt /b /s > t4list.txt
@kensykora
kensykora / purge-akamai-cache.ps1
Created May 20, 2014 16:08
Purge Akamai Cache
# Purge Akamai Cache
#
# Invokes the Akamai REST Api to purge the cache for the given objects
#
# == Usage ==
# .\purge-akamai-cache.ps1 -CpCode cpcode -User Username -Pass Password
#
# == Params ==
# CpCodes: comma separated list of cpcodes of the site to purge
# User / Pass: Valid credentials for an Akamai User that has permissions to purge cache
@kensykora
kensykora / clear-umbraco-cache.ps1
Last active August 29, 2015 14:00
Goes through the motions to log into umbraco, right click the root node, click "Republish All Content", and then click the button to confirm
# Clear Umbraco Cache
#
# Simulates a set of HTTP requests that a normal use would do to log into umbraco and clear the global site cache (republish the root node)
#
# == Usage ==
# .\clear-umbraco-cache.ps1 -HostName Hostname -User Username -Pass Password [-UseSsl $false]
#
# == Params ==
# Hostname: Hostname of the server running umbraco
# User / Pass: Valid credentials for an Umbraco User
@kensykora
kensykora / AcceptanceTests.cs
Created December 17, 2013 23:35
Helper method for invoking the FibPro executable
/// <summary>
/// Invokes FibPro and returns a string of the standard output
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private FibProOutput FibPro(string args, string interactiveInput = null)
{
var output = new StringBuilder();
var error = new StringBuilder();
var resultCode = 0;
@kensykora
kensykora / Program.cs
Created December 17, 2013 14:42
Streaming sample using TweetSharp - outputs raw JSON to console of received stream objects
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using TweetSharp;
namespace tweet_sharp_streaming
{