Skip to content

Instantly share code, notes, and snippets.

Patrick Westerhoff poke

Block or report user

Report or block poke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
poke / microsoft-docs-force-english.user.js
Last active Oct 22, 2019
[User script] Microsoft Docs: Force English
View microsoft-docs-force-english.user.js
// ==UserScript==
// @id microsoft-docs-force-english@poke
// @name Microsoft Docs: Force English
// @description Force Microsoft Docs to be displayed in English, regardless of the browser’s locale settings.
// @namespace poke
// @version 1.0.0
// @author Patrick Westerhoff
// @grant none
// @include*
// @homepageURL
poke / NanoKestrel.cs
Created Feb 7, 2018
NanoKestrel: Running Kestrel in a console application with as minimum code as possible, i.e. avoiding all the WebHost stuff
View NanoKestrel.cs
using System;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Internal;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
poke / ForwardSectionRazorPageExtensions.cs
Created Sep 20, 2017
[ASP.NET Core] RazorPage.ForwardSection extension to forward sections in intermediate layouts to the base layout
View ForwardSectionRazorPageExtensions.cs
using Microsoft.AspNetCore.Mvc.Razor;
namespace AspNetCoreUtilities
public static class ForwardSectionRazorPageExtensions
/// <summary>
/// Forward a section to the parent layout. This allows views to define
/// sections that are rendered in a parent layout without intermediate
/// layouts having to render and re-define the sections themselves.
poke / stackexchange-responsive-post-width.user.js
Last active Feb 10, 2018
[User script] StackExchange: Responsive post width
View stackexchange-responsive-post-width.user.js
// ==UserScript==
// @id stackexchange-responsive-post-width@poke
// @name StackExchange: Responsive post width
// @description Make the post width responsive
// @namespace poke
// @version 1.0.1
// @author Patrick Westerhoff
// @include *://**
// @include *://*
// @include *://*
poke / ApplicationHost.cs
Created Jul 7, 2017
Running ASP.NET Core as Windows Service with Topshelf
View ApplicationHost.cs
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Server.Kestrel;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.IO;
namespace ExampleApp
poke / hammer-icon-no.png
Last active Feb 10, 2018
[User script] StackExchange: Close hammer warning
poke / EllipsisButtonControl.xaml
Last active Apr 26, 2017
StackOverflow 43623601 – Example code for answer
View EllipsisButtonControl.xaml
d:DesignHeight="30" d:DesignWidth="300" mc:Ignorable="d">
<ControlTemplate TargetType="ContentControl">
poke / stackexchange-diff-color-toggle.user.js
Last active Feb 10, 2018
[User script] StackExchange: Show revision diff color toggle
View stackexchange-diff-color-toggle.user.js
// ==UserScript==
// @id stackexchange-diff-color-toggle@poke
// @name StackExchange: Show revision diff color toggle
// @namespace poke
// @version 1.1.1
// @author Patrick Westerhoff
// @include *://**/revisions
// @include *://**
// @include *://*/revisions
// @include *://*
poke / gw2-item-search.html
Created Jan 13, 2016
Guild Wars 2: Item search
View gw2-item-search.html
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Guild Wars 2: Item search</title>
<div id="loader">Loading…</div>
<div id="app" style="display: none;">
poke / git-backdate.ps1
Created Nov 29, 2015
git-backdate to create a repository from a folder, creating a commit for each file backdated to its file modification date
View git-backdate.ps1
Param([string] $Folder)
Write-Host 'Backdating files in folder' $Folder -ForegroundColor Green
Push-Location $Folder
git init
git commit --allow-empty -m 'Initialize repository'
Write-Host 'Looking for files: ' -NoNewLine -ForegroundColor Blue
$files = Get-ChildItem * -Recurse | ? { !$_.PSIsContainer } | sort LastWriteTime
Write-Host $files.Length -NoNewLine -ForegroundColor Yellow
You can’t perform that action at this time.