Skip to content

Instantly share code, notes, and snippets.

View DavidDeSloovere's full-sized avatar

David De Sloovere DavidDeSloovere

View GitHub Profile
@DavidDeSloovere
DavidDeSloovere / CopyChmLocalAndOpen.ps1
Created January 4, 2013 08:30
Open up an old school .CHM help file from a network path. Put the Powershell in the folder of the .CHM file and any user can launch the help file via right-click on the .PS1 and selecting 'Run with Powershell'. (Set-ExecutionPolicy might need to be set first)
$tempfolder = $env:TEMP
$chmfile = Get-ChildItem | Where-Object {$_.Extension -match "chm"}
"Copying to local temp folder: $tempfolder"
Copy-Item $chmfile $tempfolder
"Opening $chmfile"
Start-Process $tempfolder\$chmfile
@DavidDeSloovere
DavidDeSloovere / gist:1893621
Created February 23, 2012 16:33
Sample CacheAttribute for ASP.NET Web Api - i'm not saying this is the best way
namespace ProjectName.WebApi.Infrastructure
{
using System;
using System.Net;
using System.Net.Http.Headers;
using System.Web.Http.Filters;
public class CacheAttribute : ActionFilterAttribute
{
public CacheAttribute()