Skip to content

Instantly share code, notes, and snippets.

Scott Hanselman shanselman

Block or report user

Report or block shanselman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3767910
Imagine </em><a href=";255267509;66891495;c?"><em>agile project management software </em></a><em>that is brilliantly easy to use,
View gist:3523813
using System.Web.Optimization;
using dotless.Core;
namespace Optimization {
public class LessMinify : CssMinify {
public LessMinify() { }
public override void Process(BundleContext context, BundleResponse response) {
response.Content = Less.Parse(response.Content);
base.Process(context, response);
View Console.xml
<?xml version="1.0"?>
<console change_refresh="10" refresh="100" rows="35" columns="160" buffer_rows="9999" buffer_columns="0" shell="" init_dir="" start_hidden="1" save_size="0">
<color id="0" r="48" g="48" b="48"/>
<color id="1" r="0" g="0" b="128"/>
<color id="2" r="0" g="150" b="0"/>
<color id="3" r="0" g="150" b="150"/>
<color id="4" r="174" g="87" b="0"/>
<color id="5" r="128" g="0" b="128"/>
shanselman / gist:3767880
Created Sep 22, 2012
SignalR talk ideas
View gist:3767880
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 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.
shanselman / gist:992458
Created May 26, 2011
Trying to improve ASP.NET MVC Unobtrusive validation with localization
View gist:992458
$(document).ready(function () {
//Ask ASP.NET what culture we prefer, because we stuck it in a meta tag
var data = $("meta[name='accept-language']").attr("content")
//Tell jQuery to figure it out also on the client side.
//Tell the validator, for example,
// that we want numbers parsed a certain way!
View gist:8f3dac3171fc4b9bcde334d3cdc99d3b
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 / addVSVarsToPowerShell
Created Dec 11, 2018
PowerShell Profile addition to take VSVars and make it automatic in PS1
View addVSVarsToPowerShell
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])"
Write-Host "`nVisual Studio 2017 Command Prompt variables set." -ForegroundColor Yellow
View fibb.cs
using System.Collections.Generic;
namespace FibonacciTest
public static class FibonacciGenerator
public static IEnumerable<int> Fibonacci()
int current = 1, next = 1;
while (true)
You can’t perform that action at this time.