Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
@shanselman
shanselman / ohmyposhv3.json
Created December 23, 2020 03:48
My ohMyPoshv3 json
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
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
shanselman / allowlistforpihole.txt
Last active March 24, 2023 19:05
A gist with an ALLOW LIST for a PiHole to make sure your XBox and Windows Services keeps working and appropriate anonymized telemetry goes where it needs to go
analytics.twitter.com
api.mixpanel.com
api.segment.io
attestation.xboxlive.com
az416426.vo.msecnd.net
browser.pipe.aria.microsoft.com
c.bing.com
c.msn.com
c1.microsoft.com
cdn-gl.imrworldwide.com
@shanselman
shanselman / profile.json
Created May 7, 2019 04:22
Windows Terminal Profile
{
"defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"requestedTheme": "dark",
"profiles": [
{
#CHECK THE PATH ON LINE 2 and the FEED on LINE 3
cd "C:\users\scott\Downloads"
$a = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
$file
if (!(test-path $file)) {
(New-Object System.Net.WebClient).DownloadFile($url, $file)
}
General idea is/
* get an azure trial at azure.com. 10 free websites per region.
get the azure command line with npm
>npm install azure-cli --g
Now you can type "azure" and call rest services to do anything.
import your account creds:
@shanselman
shanselman / removeNetCorePreviews.ps1
Created March 3, 2018 01:33
Remove .NET Core ASK Previews - Run as admin
$choices = New-Object Collections.ObjectModel.Collection[Management.Automation.Host.ChoiceDescription]
$choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes'))
$choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&No'))
Get-WmiObject Win32_Product -filter "name LIKE '%Preview%' AND name LIKE '%SDK%'" | ForEach-Object {
$message = "ZOMG"
$question = "Uninstall " + $_.Name + "?"
$decision = $Host.UI.PromptForChoice($message, $question, $choices, 0)
if($decision -eq 0) {
$_.Uninstall()
@shanselman
shanselman / gist:3767880
Created September 22, 2012 21:24
SignalR talk ideas
SignalR makes the Realtime Web Fun
SignalR - Realtime Changes everything
SignalR - Powering the Realtime Web
-----
SignalR is a new open source library from David Fowler and Damien Edwards on the ASP.NET team. More and more applications include a realtime component like chats and stock tickers. We’ve recently see many new frameworks emerge like socket.io and node.js to solve problems of asynchrony and realtime on the web. You’ve heard of technologies like web sockets, forever frames, long polling and server-sent events. We’ll see how you can easily add SignalR and power realtime techniques to your existing ASP.NET application. What does SignalR build upon and will it scale? There will be lots of code and demos in this technical talk.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at FluentAutomation.REPL.REPL.consoleTextBox_KeyDown(Object sender, KeyEventArgs e) in c:\Projects\FluentAutomation.Repl\REPL.cs:line 303
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
<phone:PhoneApplicationPage
x:Class="AkavacheWP8.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"