How to script SQL server database role permissions

SELECT 'GRANT ' + database_permissions.permission_name +
    CASE database_permissions.class_desc
        WHEN 'SCHEMA' THEN ' ON ' +schema_name(major_id)
        WHEN 'OBJECT_OR_COLUMN' THEN
            CASE WHEN minor_id = 0 THEN ' ON ' +object_name(major_id) COLLATE Latin1_General_CI_AS_KS_WS
            ELSE ' ON ' +(SELECT object_name(object_id) + ' ('+ name + ')'
                  FROM sys.columns
                  WHERE object_id = database_permissions.major_id
                  AND column_id = database_permissions.minor_id) end
        ELSE ''
    END +
    ' TO ' + database_principals.name COLLATE Latin1_General_CI_AS_KS_WS
FROM sys.database_permissions
JOIN sys.database_principals
ON database_permissions.grantee_principal_id = database_principals.principal_id
LEFT JOIN sys.objects --left because it is possible that it is a schema
ON objects.object_id = database_permissions.major_id
WHERE permission_name in ('SELECT','INSERT','UPDATE','DELETE','EXECUTE') AND database_principals.NAME = ''

How can I see what certificates are installed on a Windows computer with PowerShell

Using PowerShell to view certificates is easy. PowerShell has a provider that exposes the certificates store which is part of the pki and security modules, which are loaded automatically as long as you’re on version 3 or greater. You do not need to manually load the modules, they auto-load from PowerShell v3 and above.
To view the certificates in the local users personal certificate store/local machine store I would use the following:  
#Change to the location of the personal certificates
Set-Location Cert:\CurrentUser\My

#Change to the location of the local machine certificates
Set-Location Cert:\LocalMachine\My

#Get the installed certificates in that location
Get-ChildItem | Format-Table Subject, FriendlyName, Thumbprint -AutoSize

Compare Branches with Beyond Compare

After I do a big merge I always like to compare my source and target branches to review the differences. My tool of choice for this is Beyond Compare as its folder compare is extremely quick and it lets me easily exclude file types and folders that of no consequence and generate noise.

This is a good starting point for the filters. It excludes your compiled code, test results, files with user settings which don't usually get checked in. 
Filter Expression: -*.dll;-*.suo;-*.pdb;-*.user;-UpgradeLog.htm;-*.lnk;-*.vspscc;-*.vssscc;-bin\;-obj\;-.vs\;-TestResults\;-.git\

This is what it looks like in Beyond compare which is a bit easier to digest

You can also save this filter by clicking "Add To Presets" and it will be added to your file filter dropdown ready to go for next time!