Skip to content

Instantly share code, notes, and snippets.

View imamkhaira's full-sized avatar

Imam Khaira imamkhaira

View GitHub Profile
@imamkhaira
imamkhaira / combiledStyleSheet.mjs
Created October 14, 2025 04:44
Create a single combined CSSStyleSheet from global styles. Convenient to add global styles to Shadow DOM.
export const combiledStyleSheet = new CSSStyleSheet();
const allRules = [...document.styleSheets]
.flatMap((ss) => {
try {
return [...ss.cssRules].map((rule) => rule.cssText);
} catch {
return []; // Skip cross-origin stylesheets
}
})
.filter(Boolean);
@imamkhaira
imamkhaira / spbackup.ps1
Created March 22, 2021 16:47
sharepoint-backup
Add-PsSnapin Microsoft.SharePoint.PowerShell
Set-Location $home
$subdomains = "epesb", "epehr"
# CHANGE TTHE VARIABLE BELOW To AN APPROPRIATE BACKUP LOCATION.
$backupdir = "C:\Users\SPFarm\Desktop"
New-Item -Path $backupdir -ItemType directory
ForEach ($subdomain in $subdomains) {