Skip to content

Instantly share code, notes, and snippets.

@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.

@cemerson
cemerson / Brave-browser-blurry-jagged-font-fix-NVidia-users.md
Last active June 6, 2023 09:43
Brave browser blurry/jagged font fix for Nvidia users
@cemerson
cemerson / Workaround-to-View-Local-File-in-Browser.html
Last active May 26, 2023 11:50
Workaround for being unable to view a local or shared drive file:/// in a browser
<!DOCTYPE html>
<html lang="en">
<!--
Very basic workaround for being unable to view local/network file:/// links in Chrome
Referencde: https://stackoverflow.com/questions/28724751/open-local-filesfile-using-chrome
To use load this file in a browser with a querystring appended w/your local or shared drive file path. Example:
https://mywebsite.com/ThisPage.html?sdfurl=C:\Documents\MyDocument.pdf
or
javascript:(function()%7Bfunction%20autoClickThroughSLOAssessment()%7Bconsole.log('autoClickThroughSLOAssessment()...')%3Blet%20nextClickDelay%20%3D%20500%3Blet%20radioCount%20%3D%20%24('.dxEditors_edtRadioButtonUnchecked').length%3Bif(radioCount%20%3E%200)%7Bconsole.log('..%20radio%20buttons%20found.')%3Blet%20rndRadioIndex%20%3D%20Math.floor(Math.random()%20*%20radioCount)%3Blet%20nextRdoButton%20%3D%20document.querySelectorAll('table%5Bid*%3D%22questionRoundPanel_answersRadioList_RB%22%5D')%5BrndRadioIndex%5D%3Bconsole.log('...%20selecting%20random%20radio%20%5B'%20%2B%20rndRadioIndex%20%2B%20'%5D')%3Bconsole.log('.....%20clicking%20random%20radio%20button')%3BnextRdoButton.click()%3B%7Dlet%20nextButton%20%3D%20document.querySelectorAll('table%5Bid*%3D%22contentPanel_stepNextButton%22%5D%20td%20div.dxb')%5B0%5D%3Bif(nextButton%20%3D%3D%20null%20%7C%7C%20nextButton%20%3D%3D%20undefined)%7Bconsole.log('.......%20all%20done!')%3B%7Delse%7Bconsole.log('......%20waiting%20sec')%3Bwindow.setTimeout(function()%7B
@cemerson
cemerson / uyou-uyouplus-install-notes-for-ios-16-3-1.md
Created May 16, 2023 11:18
uYou uYouPlus install notes for iOS 16.3.1

uYou / uYouPlus / uYouTube on iOS 16.3.1

(Reminder to self on install/process as of 5/23)

  1. Uninstall uYou, uYouImport, YouTube, uYouPlus ... basically everything YouTube from device first

  2. Install latest official YouTube app. Open. Sign-in.

  3. Uninstall YouTube app

@cemerson
cemerson / sql-get-table-fragmentation-and-reindex-scripts.sql
Last active May 15, 2023 12:28
SQL get table fragmentation and reindex scripts
-- https://stackoverflow.com/a/55742138/826308
SELECT OBJECT_NAME(ind.OBJECT_ID) AS TableName,
ind.name AS IndexName, indexstats.index_type_desc AS IndexType,
indexstats.avg_fragmentation_in_percent,
'ALTER INDEX ' + QUOTENAME(ind.name) + ' ON ' +
(QUOTENAME(object_schema_name(ind.object_id)) +
'.' + QUOTENAME(object_name(ind.object_id))) +
CASE WHEN indexstats.avg_fragmentation_in_percent>30 THEN ' REBUILD '
WHEN indexstats.avg_fragmentation_in_percent>=5 THEN ' REORGANIZE'
ELSE NULL END as [SQLQuery] -- if <5 not required, so no query needed