Skip to content

Instantly share code, notes, and snippets.

View llaughlin's full-sized avatar

Logan Laughlin llaughlin

View GitHub Profile
@kapsiR
kapsiR / Update-DotNet-Global-Tools.ps1
Created September 28, 2022 06:32
Update all dotnet global tools at once
function Update-DotNet-Global-Tools
{
foreach ($toolInfoRow in $(dotnet tool list -g | Select-Object -Skip 2))
{
$toolInfo = $toolInfoRow.Split(" ", [StringSplitOptions]::RemoveEmptyEntries)
$toolName = $toolInfo[0]
$toolVersion = $toolInfo[1].Trim()
# Fetch version from NuGet
$nugetInfo = (dotnet tool search --take 1 $toolName | Select-Object -Skip 2)
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: