Skip to content

Instantly share code, notes, and snippets.

View stephenpatten's full-sized avatar

Stephen Patten stephenpatten

View GitHub Profile
@damianh
damianh / CookieMessageHandler.cs
Created April 28, 2018 11:43
HttpMessageHandler for dealing with cookies in requests.
public class CookieMessageHandler : DelegatingHandler
{
private readonly CookieContainer _cookies = new CookieContainer();
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("Cookie", _cookies.GetCookieHeader(request.RequestUri));
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
@nrbray
nrbray / find_gits
Last active March 30, 2021 17:12
Find git repositories having a workdir - a wrapper arround find $ARGV[0] 'HEAD', modified from locate -br '^HEAD$'
#!/usr/bin/perl
# Copyright 2012, Dee Newcum. License: GPL v3.
# NRB: Original at <https://github.com/DeeNewcum/dotfiles/blob/master/bin/lsgit>
# NRB: Modified 2019-09-04, Nigel Bray [NRB]
# NRB: Forked at <https://gist.github.com/nrbray/a0ae8ec59d1fd1ae03e2947368096d2e>
# NRB: Alternative described at <https://stackoverflow.com/a/2778066/9113089> <https://pypi.org/project/uncommitted/>
# A wrapper around:
# ```` locate -br '^HEAD$'````