Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
davidfowl /
Last active April 24, 2024 15:57
.NET project structure
gitfool / .bashrc
Last active April 22, 2024 20:19
export HISTCONTROL='ignorespace:ignoredups'
export HISTIGNORE='bg:fg:clear:exit:h:history:l:l[ls]:pwd'
export HISTSIZE=10000
export AWS_PAGER=
export EDITOR=vi
export KUBECONFIG=$(find ~/.kube -maxdepth 1 -type f 2>/dev/null | grep -E 'config[^.]*$' | xargs -I{} -r echo -n ':{}')
export PATH=$HOME/.dotnet/tools:$PATH
alias h='history'
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
public void Net45Application(INetFramework45 platform)
daredude / docker-clear.bat
Created June 5, 2016 10:53
delete all docker container and images on windows
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
devblackops / redalert.ps1
Last active August 15, 2023 08:02
Display highly visible notification if the last command failed in the Microsoft Terminal using PowerShell
# Put this code in your PowerShell profile script
# This requires the MSTerminalSettings module which you can download with:
# Install-Module MSTerminalSettings -Scope CurrentUser -Repository PSGallery
Import-Module MSTerminalSettings
$msTermProfileName = 'pwsh' # Replace with whatever Terminal profile name you're using
$msTermProfile = Get-MSTerminalProfile -Name $msTermProfileName
$script:bombThrown = $false
function prompt {
if ($? -eq $false) {
FontFamily="{StaticResource PhoneFontFamilyNormal}"
anaisbetts /
Last active April 18, 2020 02:00
Getting Started with Squirrel for Windows

Getting Started

Here's how to take any EXE and create an installer for it:

  1. Install-Package
  2. Use NuGet Package Explorer (or any other way) to create a NuGet package for your app.
  3. Open the NuGet Package Console, and type Squirrel --releasify path/to/the/nuget/package.nupkg

You should have a folder called Releases with three files in it. Publish those all to S3 in the same folder and you've now got an installer

shiftkey /
Last active December 14, 2015 01:38
Some words about a project idea codenamed Duchess - the goal is to make a replacement for Sandcastle and make creating documentation for open source project cool again

Burn Sandcastle to the Ground

Addressing The Documentation Problem

I've had lots of discussions with people over the past few days around how open source projects in the .NET space have poor documentation (if it exists). So how do we fix this?

At a high-level, I've got these goals in mind:

  • make it easy
  • make it cool
<style type="text/css">
#banner img { width: 240px; height: 56px; }
#banner img.retina { display: none; }
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
#banner img.non-retina { display: none; }
#banner img.retina { display: block; }