Skip to content

Instantly share code, notes, and snippets.

View ericlaw1979's full-sized avatar
💭
Working on Microsoft Web Defense

Eric Lawrence ericlaw1979

💭
Working on Microsoft Web Defense
View GitHub Profile
@ericlaw1979
ericlaw1979 / CAE-Jpegify.cs
Created November 3, 2026 16:54
JPEGify for Clearinet.app
using Clearinet;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
[assembly: Clearinet.RequiredVersion("0.0.3.0")]
namespace MakeJPEG
{
@ericlaw1979
ericlaw1979 / WASM.aspx
Last active October 12, 2026 13:35
ffmpeg-WASM slideshow generator
<%@ Page language="C#"%>
<%
Response.AddHeader("Cross-Origin-Opener-Policy", "require-corp");
Response.AddHeader("Cross-Origin-Embedder-Policy", "same-origin");
%><!DOCTYPE html>
<html lang="en" class="h-full bg-slate-950">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Native MP3 + Image to Video Converter</title>
@ericlaw1979
ericlaw1979 / MakeAVideo.html
Last active October 12, 2026 13:35
Browser-native slideshow generator
<!DOCTYPE html>
<html lang="en" class="h-full bg-slate-950">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Native MP3 + Image to Video Converter</title>
<!-- Tailwind CSS for styling -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Lucide Icons -->
<script src="https://unpkg.com/lucide@latest"></script>
@ericlaw1979
ericlaw1979 / EnumShellHandlers.ps1
Last active September 2, 2026 15:49
Enumerates Windows file extensions that register for a Preview or Thumbnail handler
$hkcrPath = "Registry::HKEY_CLASSES_ROOT"
$previewClsid = "{8895b1c6-b41f-4c1c-a562-0d564250836f}"
$thumbnailClsid = "{E357FCCD-A995-4576-B01F-234630154E96}"
Write-Host "--------------------------------------------------"
Write-Host "Enumerating file type extensions that register" -ForegroundColor Cyan
Write-Host "preview or thumbnail handlers..." -ForegroundColor Cyan
Write-Host "--------------------------------------------------"
$extensions = Get-ChildItem -Path $hkcrPath | Where-Object { $_.PSChildName -like ".*" }
import Meddler;
import System;
import System.Net.Sockets;
import System.Windows.Forms;
// Visit this script at http://127.0.0.1:8088/
class Handlers
{
static function OnConnection(oSession: Session)
{
@ericlaw1979
ericlaw1979 / undo.reg
Created October 17, 2025 16:33
Turn Shell Previews back on regardless of file source.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3]
"180F"=dword:00000000
@ericlaw1979
ericlaw1979 / no Zstd.js
Created May 13, 2025 17:52
No zstd for Fiddler
// Add just inside here:
// static function OnBeforeRequest(oSession: Session) {
// Don't request zstd content-encoding because Telerik didn't bother adding support.
if (oSession.RequestHeaders.ExistsAndContains("Accept-Encoding", "zstd")) {
oSession.RequestHeaders["Accept-Encoding"] = oSession.RequestHeaders["Accept-Encoding"].Replace(", zstd", "");
}
@ericlaw1979
ericlaw1979 / Single.js
Last active October 21, 2025 19:04
SingleBrowserMode button for Fiddler.
// Rules > Customize Rules, place this just inside the HANDLERS class...
// Add a button to Fiddler's UI for "Single Browser Mode", where only one browser window will
// send its traffic to Fiddler.
public static BindUIButton("SingleBrowserMode \uD83D\uDC40")
function LaunchSingleInstance() {
// Tell the system we're not the proxy anymore
FiddlerApplication.UI.actDetachProxy();
// Launch a single browser instance pointed directly at Fiddler.
System.Diagnostics.Process.Start('msedge.exe',
@ericlaw1979
ericlaw1979 / ClipShield.cpp
Last active April 11, 2025 16:29
ClipShield.cpp
//See https://github.com/ericlaw1979/ClipShield/blob/main/ClipShield.cpp instead
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.google.Chrome.extensions.bkbeeeffjjeopflfhgeknacdieedcoml</key>
<dict>
<key>HideProtectionToggle</key>
<true/>
<key>PreventBlockOverride</key>
<true/>