How do I modify the URL without reloading the page?

This can now be done in Chrome, Safari, Firefox 4+, and Internet Explorer 10pp4+! See this question’s answer for more information: Updating address bar with new URL without hash or reloading the page Example: You can then use window.onpopstate to detect the back/forward button navigation: For a more in-depth look at manipulating browser history, see this MDN … Read more

How do I restart my C# WinForm Application?

Unfortunately you can’t use Process.Start() to start an instance of the currently running process. According to the Process.Start() docs: “If the process is already running, no additional process resource is started…” This technique will work fine under the VS debugger (because VS does some kind of magic that causes Process.Start to think the process is … Read more

How do I stop an active AutoHotkey script?

Add an emergency exit hotkey The most reliable method of ending an active script is to pre-emptively include an emergency ExitApp hotkey. A common practice is to place the following at the bottom of any script. You can also set hotkeys to pause, suspend, or reload your script. Log off On Windows 10/8/7/Vista, you can … Read more

HTML iframe – disable scroll

Unfortunately I do not believe it’s possible in fully-conforming HTML5 with just HTML and CSS properties. Fortunately however, most browsers do still support the scrolling property (which was removed from the HTML5 specification). overflow isn’t a solution for HTML5 as the only modern browser which wrongly supports this is Firefox. A current solution would be … Read more

C# switch on type

See gjvdkamp’s answer; this feature now exists in C# I usually use a dictionary of types and delegates. It’s a little less flexible as you can’t fall through cases, continue etc. But I rarely do so anyway.