Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
RED="$(tput setaf 1 2>/dev/null || echo '')"
GREEN="$(tput setaf 2 2>/dev/null || echo '')"
YELLOW="$(tput setaf 3 2>/dev/null || echo '')"
NO_COLOR="$(tput sgr0 2>/dev/null || echo '')"
function __ps1_bgl {
eval "$(cat /mnt/c/Users/scott/.bgl-cache)"
local trend="?"
case "${nightscout_trend}" in
@shanselman
shanselman / fibb.cs
Created November 21, 2018 21:08
Fibb
using System.Collections.Generic;
namespace FibonacciTest
{
public static class FibonacciGenerator
{
public static IEnumerable<int> Fibonacci()
{
int current = 1, next = 1;
while (true)
<p>It's always the little throwaway tweets that go picked up. Not the ones that we agonize over. I was doing some work at the command line and typed "dotnet --version | clip" to copy the .NET Core version number into the clipboard. Then I tweeted a little "hey, remember this great utility?" and then the plane took off. I landed two hours later and it had over 500 RTs. Madness. </p> <p>It's funny that 10 year old command prompt utility (this was added in Vista) that everyone's forgotten elicits such an enthusiastic response.</p> <p>Since you all love that stuff, here's a few other "forgotten command prompt features."</p> <center> <blockquote class="twitter-tweet" data-lang="en"> <p lang="en" dir="ltr">Windows folk: Did you know you can pipe cmd prompt commands into the clipboard? <a href="https://t.co/fSE7ZHBBbB">pic.twitter.com/fSE7ZHBBbB</a></p>— Scott Hanselman (@shanselman) <a href="https://twitter.com/shanselman/status/744967489356865538">June 20, 2016</a></blockquote><script async src="//platform.twitte
<figure><a href="https://flic.kr/p/9arwvh"><img title="Burnout photo by Michael Himbeault used under cc" style="display: inline" alt="Burnout photo by Michael Himbeault used under cc" src="http://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Burnout-Or-just-a-natural_CE1C/5357683026_a34d4df4ba_b_0d1090af-d456-4276-8f7d-19186a95d315.jpg" width="999" height="330"></a></figure> <p><a href="https://twitter.com/sarahmei">Sarah Mei</a> had a great series of tweets last week. She's a Founder of RailsBridge, Director of Ruby Central, and the Chief Consultant of <a href="https://www.devmynd.com/">DevMynd</a> so she's experienced with work both "on the job" and "on the side." Like me, she organizes OSS projects, conferences, but she also has a life, as do I.</p> <p>If you're reading this blog, it's likely that you have gone to a User Group or Conference, or in some way did some "on the side" tech activity. It could be that you have a blog, or you tweet, or you do videos, or you volunteer at a school.</p>
C:\Users\scottha>where chromedriver
c:\Python27\chromedriver.exe
@shanselman
shanselman / addVSVarsToPowerShell
Created December 11, 2018 01:23
PowerShell Profile addition to take VSVars and make it automatic in PS1
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
Write-Host "`nVisual Studio 2017 Command Prompt variables set." -ForegroundColor Yellow
mkdir "~\Desktop\AzureFriday"
cd "~\Desktop\AzureFriday"
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring("http://channel9.msdn.com/Shows/Azure-Friday/feed/mp4high"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
"Downloading: " + $file
if (!(test-path $file))
{
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
@shanselman
shanselman / keybase.md
Created February 9, 2015 06:30
keybase.md

Keybase proof

I hereby claim:

  • I am shanselman on github.
  • I am shanselman (https://keybase.io/shanselman) on keybase.
  • I have a public key whose fingerprint is E010 F4EC CF9A D085 FD3C A875 AE91 5B1E FA9A DBD0

To claim this, I am signing this object:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
namespace WebApplication
{
public class Program{