Skip to content

Instantly share code, notes, and snippets.

Avatar

EM3R50N cemerson

View GitHub Profile
@cemerson
cemerson / 7zip_AllFiles_Seperate_Zips.txt
Created Oct 19, 2020
Create seperate zip from every file in folder
View 7zip_AllFiles_Seperate_Zips.txt
FOR %i IN (*.*) DO "C:\Program Files (x86)\7-Zip\7z.exe" a "%~ni.zip" "%i"
@cemerson
cemerson / salesforce-clear-or-abort-running-tests.js
Last active Sep 30, 2020
SFDC: Clear running or stuck Apex Tests
View salesforce-clear-or-abort-running-tests.js
/* Use if/when you have tests that are stuck in the middle or running
(sometimes this can happen and you can't actually see/confirm it -
in which case running this will clear everything out) */
List<ApexTestQueueItem> atqi_list = [select id, status from apextestqueueitem where status NOT IN ('Completed', 'Failed', 'Aborted')];
for(ApexTestQueueItem atqi : atqi_list)
atqi.status = 'Aborted';
update atqi_list;
@cemerson
cemerson / tsql_get_all_table_rowcounts.sql
Created Sep 2, 2020
TSQL get all database rowcounts
View tsql_get_all_table_rowcounts.sql
CREATE TABLE #counts
(
table_name varchar(255),
row_count int
)
EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
SELECT table_name, row_count FROM #counts ORDER BY row_count DESC
DROP TABLE #counts
@cemerson
cemerson / vs2019-ctrl-r-errorLog.txt
Last active Aug 10, 2020
VS2019-CtrlRNotWorkingLog-20200810
View vs2019-ctrl-r-errorLog.txt
Reference: https://stackoverflow.com/questions/63343639/ctrlr-ctrlr-stopped-working-throwing-error-in-visual-studio-2019-resharper
2848 ERROR System.InvalidOperationException:
System.InvalidOperationException: Unexpected false at Roslyn.Utilities.Contract.Fail(String message) at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition) at Microsoft.VisualStudio.LanguageServices.Implementation.InlineRename.VisualStudioInlineRenameUndoManagerServiceFactory.InlineRenameUndoManager.CreateStartRenameUndoTransaction(Workspace workspace, ITextBuffer subjectBuffer, InlineRenameSession inlineRenameSession) at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.OpenTextBufferManager..ctor(InlineRenameSession session, ITextBuffer subjectBuffer, Workspace workspace, ITextBufferFactoryService textBufferFactoryService) at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.TryPopulateOpenTextBufferManagerForBuffer(ITextBuffer buffer) at Microsoft.CodeAnalysis.Editor.Im
View bitchute_embed_in_wordpress.md
@cemerson
cemerson / helpful-ffmpeg-commands.md
Last active Jul 30, 2020
Helpful FFMPEG commands
View helpful-ffmpeg-commands.md

Helpful FFMPEG commands

Combine Image and MP3 into a new MP4

V1:

ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4

V2 (alt?):

@cemerson
cemerson / git-branch-to-master.md
Created Jan 29, 2020
GIT: push branch to master remote
View git-branch-to-master.md

// https://stackoverflow.com/a/5434370/826308 git checkout master git pull # to update the state to the latest remote master state git merge develop # to bring changes to local master from your develop branch git push origin master # push current HEAD to remote master branch

@cemerson
cemerson / TSQL-Get DB rowcount and filesize.sql
Created Oct 10, 2019
TSQL: Query to get row count and KB/MB file space usage of SQL database
View TSQL-Get DB rowcount and filesize.sql
-- https://stackoverflow.com/a/7892349/826308
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
@cemerson
cemerson / dissenter-adblock-plus-settings-export.md
Last active Sep 17, 2019
Copy Adblock Plus settings to another machine
View dissenter-adblock-plus-settings-export.md

Copying Adblock Plus settings from one Chrome browser to another

Steps below are for Dissenter so replace \GabAI\Dissenter\ below with \Google\Chrome\ if you use their version of Chrome.

  1. Close your browser on the TARGET machine
  2. (Backup if you want then) Delete contents of this folder on the TARGET machine: C:\Users\YourUsername\AppData\Local\GabAI\Dissenter\User Data\Default\Local Extension Settings\cfhdojbkjhnklbpkdaibdccddilifddb
  3. Copy the files from the same folder above on the SOURCE machine and copy them into the folder you just emptied in step #2 above
  4. Start your browser on the TARGET machine and test your Adblock Plus settings. With any luck, like me, your Adblock Plus settings/filters will have been copied over!
View sso-metadata-file-example.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EntityDescriptor entityID="mainsite.com/portalfolder" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"><SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"><NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat><AssertionConsumerService index="0" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://mainsite.com/portalfolder/login"/></SPSSODescriptor></EntityDescriptor>
You can’t perform that action at this time.