Skip to content

Instantly share code, notes, and snippets.

@cemerson
cemerson / autohotkey-excel-extract-hyperlinks-from-selected-cells-cemerson.ahk
Last active March 18, 2024 14:23
AutoHotkey/Excel: Extract Hyperlinks from Selected Cells
@cemerson
cemerson / chatgtp-fix-export-button-hack.js
Created February 9, 2024 11:01
ChatGPT: Fix app export buttons (hack)
async function fixChatGPTExport() {
chatConf = (await invoke('get_app_conf')) || {};
actionsArea = document.querySelector('form>div>div>div');
function shouldAddButtons(actionsArea) {
// first, check if there's a "Try Again" button and no other buttons
const buttons = actionsArea.querySelectorAll('button');
const hasTryAgainButton = Array.from(buttons).some((button) => {
return !/download-/.test(button.id);
@cemerson
cemerson / ms-excel-delete-all-worksheets-but-one-2024.md
Created January 16, 2024 13:37
MS Excel - Delete All Worksheets at once but one

In Microsoft Excel, there isn't a built-in feature to delete all worksheets except one directly. However, you can use a VBA (Visual Basic for Applications) macro to achieve this. Here's a step-by-step guide:

Press Alt + F11 to open the VBA editor. In the editor, insert a new module by right-clicking on any item in the Project Explorer, selecting Insert, and then choosing Module. Copy and paste the following VBA code into the module: vba Copy code Sub DeleteAllSheetsExceptOne() Dim ws As Worksheet Dim wsToKeep As Worksheet

@cemerson
cemerson / ssl-generate-self-signed-cert-2023111x.md
Created November 16, 2023 13:34
SSL: Generate self signed cert via powershell

// Run in powershell as admin - change all ##values## as needed

$authorityCert = New-SelfSignedCertificate -Subject "CN=##MyCertFriendlyName##,OU=IT,O=##MyCompanyName## Certificate Authority,C=US" -KeyAlgorithm RSA -KeyLength 4096 -KeyUsage CertSign, CRLSign, DigitalSignature, KeyEncipherment, DataEncipherment -KeyExportPolicy Exportable -NotBefore (Get-Date) -NotAfter (Get-Date).AddYears(10)

@cemerson
cemerson / chrome-fix-the-your-connection-is-not-private-issue-for-localhost-dev-work.md
Created November 15, 2023 11:14
Chrome: Fix the Your Connection is not Private issue for localhost dev work

In Chrome, browse to: chrome://flags/ . Search for “insecure” and you should see the option to “Allow invalid certificates for resources loaded from localhost.” Enable that option and restart your browser.Oct 18, 2023

@cemerson
cemerson / bookmarklet-rumble-com-sort-video-search-results-by-duration.js
Created November 13, 2023 10:58
Rumble.com: Bookmarklet sort video search results by duration
/* Rumble.com: Sort video search results page by duration (low to high) */ javascript:(function() {%0A %2F%2F Get all the <li> elements with the class 'video-listing-entry'%0A const videoEntries %3D document.querySelectorAll('li.video-listing-entry')%3B%0A%0A %2F%2F Convert the NodeList to an array for easier sorting%0A const videoEntriesArray %3D Array.from(videoEntries)%3B%0A%0A %2F%2F Custom sorting function to sort by video duration%0A function compareDurations(a%2C b) %7B%0A %2F%2F Get the duration values from the data-value attribute of <span> elements%0A const durationA %3D a.querySelector('.video-item--duration').getAttribute('data-value')%3B%0A const durationB %3D b.querySelector('.video-item--duration').getAttribute('data-value')%3B%0A%0A %2F%2F Convert the duration strings to time in seconds for comparison%0A const timeA %3D convertDurationToSeconds(durationA)%3B%0A const timeB %3D convertDurationToSeconds(durationB)%3B%0A%0A %2F%2F Compare and return the result%0A ret
@cemerson
cemerson / skyrim-gamepad-setup-for-tk-dodge.md
Created September 19, 2023 17:27
Skyrim Gamepad Setup for TK Dodge #skyrim #gamepad

Skyrim Gamepad Setup for TK Dodge

This is mainly a note to self so I don't have to re-learn the next time I start a Skyrim run. In the end the TK Dodge should be controlled by the gamepad X button, Weapon/Sheath should be d-pad down and Stealth remains L3 click. Obviously this can be changed however if someone wants to use this approach w/a different config.

Setup

Steam Gamepad Button Changes

  • X button = Right Alt Key
  • DPad Down = R Key
  • L3 Stick Click = Left Ctrl Key
@cemerson
cemerson / bulk-delete-lastpass-vault-passwords.md
Last active September 12, 2023 11:53
Bulk Delete Passwords from LastPass (DevTools script)

LASTPASS BULK Password Delete DevTools Hack

Version: 2023091201

Background

As of 9/2023 LastPass still apparently has no way to allow bulk deletion of passwords without clicking a checkbox on every single password. For many this is fine but for some like me this is very tedious. Frankly it's unacceptable that LastPass, who I pay $ to every year for Premium, still has no "Select All" option here.

@cemerson
cemerson / vs-code-extension-list-202308xx.md
Created August 29, 2023 10:35
VS Code Extension List (202308xx)

Audibene.salesforcecodesnippets@3.2.2 chuckjonas.apex-pmd@0.6.0 chuckjonas.salesforce-diff@0.0.7
Dart-Code.dart-code@3.70.0 Dart-Code.flutter@3.70.0 dbaeumer.vscode-eslint@2.4.2 eamodio.gitlens@14.2.1 eg2.vscode-npm-script@0.3.29 emmanuelbeziat.vscode-great-icons@2.1.97 esbenp.prettier-vscode@10.1.0

@cemerson
cemerson / http-to-https-redirect-for-aspnet-loadbalancerFriendly.xml
Created August 9, 2023 20:00
HTTP to HTTPS redirect for web.config (ASP.NET)
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{SERVER_NAME}{URL}" redirectType="Found" />
</rule>