Skip to content

Instantly share code, notes, and snippets.

View szalapski's full-sized avatar

Patrick Szalapski szalapski

View GitHub Profile
@szalapski
szalapski / gcp.bat
Last active February 25, 2024 18:12
@rem gcp.bat: Git Add, Commit, Push
@rem USAGE: gcp [just type your commit message without any quotation marks anywhere]
@rem EXAMPLE: gcp code cleanup for abc feature for issue 1234
git add -A && git commit -m "%*"
@if errorlevel 1 goto end
git push
:end
@inject NavigationManager navigationManager
...
@code {
// example code to change state based on the querystring.
// Call perhaps from an event callback or whenever the query may have changed.
private void LoadFromQuery()
{
Uri uri = navigationManager.ToAbsoluteUri(navigationManager.Uri);
public static class GeneralExtensions {
/// <summary>
/// Throws an exception if the task fails to complete within a number of milliseconds from when invoked.
/// </summary>
/// <param name="task">The task on which to enforce the timeout</param>
/// <param name="milliseconds">The timeout in milliseconds.</param>
/// <param name="operationDescription">The text description that should appear in the timeout exception message.
/// Useful for pinpointing the timed-out operation.</param>
/// <returns>The completed task, if the task completed in time.</returns>
/// <exception cref="TimeoutException">Thrown when the timeout is reached before the task is completed.</exception>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace GeneralMills.ResourceDemand.Core.Extensions
{
/// <summary>
/// Contains static methods for working with data queries and LINQ.
/// </summary>
@szalapski
szalapski / TfsWebCompact.bookmarklet.js
Last active January 26, 2024 15:06
TfsWebCompact neatens up the look-and-feel of your Azure DevOps web backlog and task board. See also http://www.szalapski.com/2014/05/a-compact-layout-for-tfs-web-work-items.html .
/* The following is a bookmarklet.
To actually use it, it is easier to drag-and-drop starting with my blog post:
http://www.szalapski.com/2014/05/a-compact-layout-for-tfs-web-work-items.html */
javascript:/* version 2024-01-26 */(function () { var s = document.createElement('style'); s.innerText = `
/* for backlog list */
#header-row {display: none;}
.header-section .hubs-section {left:300px; top:-5px;}
.nav-separated .hub-groups-section, .nav-separated .search-box {margin-top:0; padding-top:0;}