Skip to content

Instantly share code, notes, and snippets.

@poke
poke / stackexchange-chat-unstar-transcript.user.js
Last active August 29, 2015 14:07
[User script] StackExchange Chat: Unstar from transcript
// ==UserScript==
// @id stackexchange-chat-unstar-transcript@poke
// @name StackExchange Chat: Unstar from transcript
// @namespace poke
// @version 1.0.0
// @author Patrick Westerhoff
// @include http://chat.stackoverflow.com/transcript/*
// @homepageURL https://gist.github.com/poke/d1fd6b5227efc5885cac
// @updateURL https://gist.githubusercontent.com/poke/d1fd6b5227efc5885cac/raw/stackexchange-chat-unstar-transcript.user.js
// @run-at document-end
@poke
poke / Include-committer-name-in-last-change.patch
Created July 9, 2012 13:15
[PATCH] GitWeb: Include committer name in last change.
From: Patrick Westerhoff <PatrickWesterhoff@gmail.com>
Date: Mon, 9 Jul 2012 14:07:28 +0200
Subject: [PATCH] Include committer name in last change.
diff --git a/gitweb.cgi b/gitweb.cgi
index 2bd0d29..fbb1659 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -3170,9 +3170,10 @@ sub git_get_last_activity {
close $fd or return;
@poke
poke / gist:5627036
Created May 22, 2013 12:01
Guild Wars 2 API example using RestSharp
using RestSharp;
using System;
using System.Collections.Generic;
namespace Gw2ApiExample
{
class Program
{
public static void Main()
{
@poke
poke / EllipsisButtonControl.xaml
Last active April 26, 2017 14:56
StackOverflow 43623601 – Example code for answer http://stackoverflow.com/a/43628625/216074
<ContentControl
x:Class="WpfTest.EllipsisButtonControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfTest"
d:DesignHeight="30" d:DesignWidth="300" mc:Ignorable="d">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
@poke
poke / ForwardSectionRazorPageExtensions.cs
Created September 20, 2017 13:15
[ASP.NET Core] RazorPage.ForwardSection extension to forward sections in intermediate layouts to the base layout
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
poke / SvnDumpToolEdit.py
Created October 8, 2010 01:49
SvnDumpToolEdit: SVN Dump content editor
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
SvnDumpToolEdit: SVN Dump content editor
SvnDumpToolEdit is a small script that allows to change single file nodes
within an SVN dump file. It automatically updates the Content-length attribute
for nodes and generates a new MD5 checksum when a file is changed. This ensures
that the SVN dump will always remain a valid dump file.
@poke
poke / stackexchange-chat-mass-unstar.user.js
Last active February 8, 2018 23:21
[User script] StackExchange Chat: Mass-unstar from the star list
// ==UserScript==
// @id stackexchange-chat-mass-unstar@poke
// @name StackExchange Chat: Mass-unstar from the star list
// @namespace poke
// @version 1.2.0
// @author Patrick Westerhoff
// @include *://chat.stackoverflow.com/rooms/info/*
// @include *://chat.stackexchange.com/rooms/info/*
// @include *://chat.meta.stackexchange.com/rooms/info/*
// @homepageURL https://gist.github.com/poke/ab25d627b2c4b02db6b8
@poke
poke / stackexchange-responsive-post-width.user.js
Last active February 10, 2018 02:25
[User script] StackExchange: Responsive post width
// ==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 *://*.stackexchange.com/questions/*
// @include *://meta.serverfault.com/questions/*
// @include *://meta.stackoverflow.com/questions/*
@poke
poke / mailserver.py
Last active May 15, 2018 10:07
Simple debug mail server
#!/usr/bin/env python3
import argparse
import asyncore
import email.header
import email.parser
import smtpd
def decodeHeader (value):
return email.header.make_header(email.header.decode_header(value))
@poke
poke / stackexchange-election-primary-counter.user.js
Last active March 12, 2019 20:48
[User script] StackExchange Election: Primary counter – Support on Stack Apps: http://stackapps.com/questions/4548
// ==UserScript==
// @id stackexchange-election-primary-counter@poke
// @name StackExchange Election: Primary counter
// @namespace poke
// @version 1.5.2
// @author Patrick Westerhoff
// @match *://*.stackoverflow.com/election*
// @match *://*.stackexchange.com/election*
// @match *://*.askubuntu.com/election*
// @match *://*.mathoverflow.net/election*