Skip to content

Instantly share code, notes, and snippets.

@cemerson
cemerson / sql-script-copy-entire-database-in-ms-sql-server.sql
Created October 26, 2021 10:39
Script to copy entire database in MS SQL Server
-- Script to copy entire database in MS SQL Server
-- (Source: https://stackoverflow.com/a/79691/826308)
-- VARIABLES
DECLARE @dbSrcName as nvarchar(max) = 'Northwind';
DECLARE @dbCopyName as nvarchar(max) = 'Northwind_20211026';
DECLARE @dbCopyFilesPath as nvarchar(max) = 'E:\\Backups\\';
-- (change if needed)
DECLARE @dbSrcLogicalName as nvarchar(max) = @dbSrcName;
DECLARE @dbSrcLogicalLogName as nvarchar(max) = @dbSrcName + '_log';
@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 / captcha.js
Created February 8, 2013 21:33
JavaScript: Client-Side CAPTCHA (Math)
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript">
function addNums(){
@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>
@cemerson
cemerson / git-new-repo-push-up.md
Created July 7, 2023 10:06
git new repo push up
@cemerson
cemerson / c-sharp-hello-world-class-with-unit-test.cs
Created June 16, 2023 14:28
Example (Hello World) C# class and unit test example
// BASIC C# class/file
using System;
class HelloWorld
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
@cemerson
cemerson / vs-code-git-credentials-fix.md
Created June 16, 2023 12:52
VS Code git credentials fix
@cemerson
cemerson / javascript-to-capital-case.js
Created June 15, 2023 11:14
javascript to capital case
String.prototype.toCapitalCase = function () {
return this.split(' ')
.map(w => w[0].toUpperCase() + w.substring(1).toLowerCase())
.join(' ');
};
@cemerson
cemerson / Excel-solution-to-unable-to-insert-new-row-data-tables-power-query-2023061x.md
Created June 13, 2023 10:49
Solution when unable to insert new row in Excel data table/power query

Excel Issue: Unable to Add Row in Excel

https://superuser.com/questions/1245852/unable-to-add-row-in-excel/1788814#1788814

Solution (?)

https://superuser.com/a/1788814/245560

I got stuck on this issue as well but none of the typical solutions worked for me. I was not using filters, and I could not "Convert to Range" otherwise my solution would break.

My file had a few worksheets w/data converted to "Tables" which were being consolidated into a Power Query to be displayed on another single worksheet which refreshed at specified intervals changes were made.