Skip to content

Instantly share code, notes, and snippets.

@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
{
@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 / 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 / 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 / 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 / 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 / Readme.md
Last active August 29, 2015 14:05
Running Puppet in Packer

By @dylanmei

This works for me. Maybe there's something here for you as well.

in template.json, simplified

  ...
  "provisioners": [{
      "type": "file",
 "source": "./puppet",
@kensykora
kensykora / Configure.ps1
Last active March 21, 2017 13:42
Getting Started with Vagrant and Windows Boxes
$windowsFeatures = @(
'Web-Server',
'Web-WebServer',
'Web-Mgmt-Console',
'Web-Mgmt-Tools'
);
Install-WindowsFeature -Name $windowsFeatures
#Workaround for IIS Permissions Issues
@kensykora
kensykora / Config.cs
Last active August 29, 2015 14:06
UI Unit Testing with SauceLabs while allowing local testing
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Runtime.Remoting.Messaging;
namespace Website.Tests.UI
{
public static class Config
@kensykora
kensykora / start.html
Created October 3, 2014 20:55
StartSSL "select your TLD" dropdown
<select name="ext">
<option value="2000.hu">2000.hu</option>
<option value="6bone.pl">6bone.pl</option>
<option value="aa.no">aa.no</option>
<option value="aarborte.no">aarborte.no</option>
<option value="ab.ca">ab.ca</option>
<option value="ab.se">ab.se</option>
<option value="abo.pa">abo.pa</option>
<option value="ac">ac</option>
<option value="ac.ae">ac.ae</option>