Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
public class
public class foo
<?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"/>
(1..366) | foreach {
$url = New-Object System.Uri("" + $_ + ".jpg")
$file = $url.Segments[-1]
(New-Object System.Net.WebClient).DownloadFile($url, "c:\hm\" + $file)
shanselman / start480x800.1024.bat
Created December 6, 2012 22:21
Start WP8 SDK Emulator
@echo off
"C:\Program Files (x86)\Microsoft XDE\8.0\xde.exe" -createDiffDisk "C:\Users\Erik\AppData\Local\Microsoft\XDE\dd.480x800.1024.vhd" -vhd "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.480x800.vhd" -name "Emulator WVGA.erik" -memsize 1024
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);
shanselman / gist:992458
Created May 26, 2011 02:55
Trying to improve ASP.NET MVC Unobtrusive validation with localization
$(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!
shanselman / ParadoxGlucose.psm1
Created July 21, 2020 00:30
My oh-my-posh prompt with glucose values from nightscout-ps1
#requires -Version 2 -Modules posh-git
function Write-Theme {
shanselman /
Last active April 30, 2022 08:44 — forked from JonDouglas/
TikTok downloader
from TikTokApi import TikTokApi
import random
import string
proxy = "some_cool"
api = TikTokApi.get_instance(use_test_endpoints=True)
did = ''.join(random.choice(string.digits) for num in range(19))
count = 500
<rewriteMaps configSource="rewritemaps.config" />
<rule name="Redirect Rule" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<add input="{StaticRedirects:{URL}}" pattern="(.+)" />
<action type="Redirect" url="{C:1}" appendQueryString="false" redirectType="Permanent" />