Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
shanselman / ohmyposhv3-v2.json
Last active April 18, 2024 22:35
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
- main
vmImage: 'ubuntu-latest'
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
Import-Module PSReadLine
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
shanselman / aspnetcore.yml
Created October 31, 2017 17:00
apiVersion: v1
kind: Service
name: aspnetcoreapp
app: aspnetcoreapp
type: NodePort
shanselman / gist:5191659
Last active March 29, 2024 03:19
Sendy web.config for running on the root of a site on Windows or Azure
<rule name="Sendy all" stopProcessing="true">
<match url="^([a-zA-Z0-9-]+)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
shanselman / gist:5422230
Last active March 28, 2024 10:33
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
shanselman / setupmachine.bat
Last active March 21, 2024 09:15
WinGet Setup a New Machine
mkdir c:\github
winget install --id=Git.Git -e --accept-package-agreements --accept-source-agreements
winget install --id=Microsoft.VisualStudioCode -e
winget install --id=AgileBits.1Password -e
winget install --id=7zip.7zip -e
winget install --id=Twilio.Authy -e
winget install --id=Bethesda.Launcher -e
winget install --id=Microsoft.Bicep -e
winget install --id=Microsoft.bitsmanager -e
winget install --id=BrutalChess.BrutalChess -e
"$schema": "",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
"defaultProfile": "{79285a8e-036c-446f-8a9c-78994e34bf85}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"showTabsInTitlebar": true,
"requestedTheme": "dark",
"profiles": [
shanselman / Dockerfile
Last active November 10, 2023 19:17
Smarter ASP.NET Core Docker File
FROM microsoft/dotnet:2.0-sdk as builder
RUN mkdir -p /root/src/app/aspnetcoreapp
WORKDIR /root/src/app/aspnetcoreapp
#copy just the project file over
# this prevents additional extraneous restores
# and allows us to resuse the intermediate layer
# This only happens again if we change the csproj.
# This means WAY faster builds!