Skip to content

Instantly share code, notes, and snippets.

TaoK / CDOSysEmbeddedImages.vbs
Created Aug 30, 2012
VBScript/VBA function for sending HTML email with embedded images
View CDOSysEmbeddedImages.vbs
'This function is intended to make it a little easier to add images to emails when sending them
' through CDOSYS (CDO.Message). If all the following are true, this may help:
' - You want to send an HTML email, with one or more images in the email body
' - You want the images to be in the email itself, so that they display without any security or privacy warnings
' - You don't want the images to show up explicitly as "Attachments" in email clients like Microsoft Outlook
' - You don't want to use the images to "track" who has read your emails (that requirement would be incompatible with the rest)
' - You are using VBScript (ASP, WSH) or Office Visual Basic for Applications (VBA), or Visual Basic 6 (VB6)
' This code is loosely based on a collection of prior resources/examples online:
' - VBS/VBA versions using "AddRelatedBodyPart":
TaoK / Diff.cs
Created May 8, 2012
C# port of JS 3-way merge implementation in Synchrotron
View Diff.cs
// Copyright (c) 2006, 2008 Tony Garnock-Jones <>
// Copyright (c) 2006, 2008 LShift Ltd. <>
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
TaoK / jQuery.base64.js
Created Jan 12, 2012
jQuery BASE64 functions (yet another)
View jQuery.base64.js
* jQuery BASE64 functions
* <code>
* Encodes the given data with base64.
* String $.base64Encode ( String str )
* <br />
* Decodes a base64 encoded data.
* String $.base64Decode ( String str )
TaoK / Invoke-ElevatedCommand.ps1
Created Jan 9, 2012
Invoke-ElevatedCommand for Administrator-level commands in a common powershell pipeline
View Invoke-ElevatedCommand.ps1
Function Invoke-ElevatedCommand {
Invokes the provided script block in a new elevated (Administrator) powershell process,
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output
will be LOST - only the object pipeline and errors are handled. In general, prefer
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information.
Also see Community Extensions "Invoke-Elevated"/"su"
TaoK / JQuerySerializeCheckbox.js
Created Jan 6, 2012
JQuery Serialize Method with Checkbox False Output
View JQuerySerializeCheckbox.js
(function ($) {
$.fn.serialize = function (options) {
return $.param(this.serializeArray(options));
$.fn.serializeArray = function (options) {
var o = $.extend({
checkboxesAsBools: false
}, options || {});
TaoK / ClrXmlShredder.cs
Created Jun 19, 2011
ClrXmlShredder - a CLR Stored Procedure for shredding the Xml result of "FOR XML"
View ClrXmlShredder.cs
ClrXmlShredder - a CLR Stored Procedure for shredding the Xml result of "FOR XML"
Copyright Tao Klerks, June 2011,
Licensed under the modified BSD license (license text below).
TaoK / TextFileEncodingDetector.cs
Last active Apr 28, 2022
Simple class to automatically detect text file encoding, with English-biased "best guess" heuristic based on byte patterns in the absence of BOM.
View TextFileEncodingDetector.cs
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
namespace KlerksSoft
public static class TextFileEncodingDetector