How to find your Windows 10 Product Key after the upgrade

source Save the following as a .vbs Option Explicit Dim objshell,path,DigitalID, Result Set objshell = CreateObject(“WScript.Shell”) ‘Set registry key path Path = “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\” ‘Registry key value DigitalID = objshell.RegRead(Path & “DigitalProductId”) Dim ProductName,ProductID,ProductKey,ProductData ‘Get ProductName, ProductID, ProductKey ProductName = “Product Name: ” & objshell.RegRead(Path & “ProductName”) ProductID = “Product ID: ” & objshell.RegRead(Path & “ProductID”) ProductKey = “Installed Key:… Read more →

Dealing with a MySQL warning from my hosting provider

I got a warning email from my hosting company today MySQL Quota DB: has used 136.87 MB out of 50 MB limit After some research I discovered that 2 database tables used by Apocalypse Meow are using approx. 120MB. I resolved the issue: Delete the data: open Apocalypse Meow settings page and click Purge ALL data Reclaim the disk space:… Read more →

LINQ: Group a list of strings into chunks

LINQ: Group a list of strings into chunks, dividing the chunks by a whole-line marker (in the example “<Custom>”) public static partial class Queries { public static IEnumerable<string[]> Execute( this IQueryHandler<DataChunker, IEnumerable<string[]>> handler, IEnumerable<string> data) { return handler.Execute(new DataChunker(data)); } public class DataChunker : IQuery<IEnumerable<string[]>> { public DataChunker(IEnumerable<string> data) { this.Data = data; } public IEnumerable<string> Data { get; set;… Read more →

Markdown and Prettify V2

Install the smart syntax plugin Go to Smart Syntax settings tab and ensure that Custom Skin is ticked Remove the following from smart-syntax/includes/functions.php: remove all 3 lines ?> <script>prettyPrint()</script> <?php Open file wp-content/plugins/smart-syntax/assets/css/smart_syntax.css and replace the contents with this: .prettyprint .com { color: #008000; } .prettyprint .str, .tag { color: #A31515; } .prettyprint .kwd, .atv { color: #0000FF; } .prettyprint… Read more →

Give background threads time to complete in IIS

Thanks to this post public sealed class OutOfProcessMediatorDecorator<TCommand> : IMediatingHandler<TCommand>, IRegisteredObject where TCommand : IMediator { private readonly IMediatingHandler<TCommand> decorated; private readonly Container container; public OutOfProcessMediatorDecorator( IMediatingHandler<TCommand> decorated, Container container) { this.decorated = decorated; this.container = container; } public void Execute(TCommand command) { HostingEnvironment.RegisterObject(this); var task = Task.Factory.StartNew(() => { using(container.BeginLifetimeScope()) { try { this.decorated.Execute(command); } finally { HostingEnvironment.UnregisterObject(this); }… Read more →


interaction from javascript in the Document to external C# code [ComVisible(true)] public class ScriptProxy { // This method can be called from JavaScript. public void AMethod(string message) { MessageBox.Show(message); } } this.webBrowser1.ObjectForScripting = new ScriptProxy(); <input type=”button” value=”Go Again!” onclick=”window.external.AMethod(‘Hello’);” /> subscriber to browser events thanks to this answer [ComVisible(true)] [ClassInterface(ClassInterfaceType.AutoDispatch)] public class EventListener { [DispId(0)] public void NameDoesNotMatter(object data)… Read more →