Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
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)
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 / 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.
Thanks.|
(1..366) | foreach {
$url = New-Object System.Uri("http://hanselminutes.com/images/shows/" + $_ + ".jpg")
$file = $url.Segments[-1]
$file
(New-Object System.Net.WebClient).DownloadFile($url, "c:\hm\" + $file)
}
@shanselman
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
<configuration>
<system.webServer>
<rewrite>
<rules>
<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" />
</conditions>
<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}"
@shanselman
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
@shanselman
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
Imagine </em><a href="http://ad.doubleclick.net/clk;255267509;66891495;c?http://www.ontimenow.com/?utm_source=hanselman&utm_medium=text&utm_content=imagine&utm_campaign=2012-04"><em>agile project management software </em></a><em>that is brilliantly easy to use,
@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.