This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/choraria/gas-url-shortener/blob/master/apps-script/Helper.gs | |
function removeEmptyColumns(sheetName) { | |
var activeSheet = ss.getSheetByName(sheetName) | |
var maxColumns = activeSheet.getMaxColumns(); | |
var lastColumn = activeSheet.getLastColumn(); | |
if (maxColumns-lastColumn != 0){ | |
activeSheet.deleteColumns(lastColumn+1, maxColumns-lastColumn); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "ES6" | |
}, | |
"exclude": [ | |
"node_modules", | |
"**/node_modules/*" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::==================================================================== | |
:: Powershell script launcher | |
:: ref: https://stackoverflow.com/questions/10137146/is-there-a-way-to-make-a-powershell-script-work-by-double-clicking-a-ps1-file | |
::===================================================================== | |
:MAIN | |
@echo off | |
for /f "tokens=*" %%p in ("%~p0") do set SCRIPT_PATH=%%p | |
pushd "%SCRIPT_PATH%" | |
powershell.exe -sta -c "& {.\%~n0.ps1 %*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ComputersToWorkOn = @("Server11","Server12","Server13","Server14","Server15") | |
$report = @() | |
foreach ($computer in $ComputersToWorkOn) { | |
Write-Host "Working on $computer ..." | |
$obj = Invoke-Command -ComputerName $computer -ScriptBlock { | |
# Count services with the name 'Integration Client Service' | |
$InstalledServices = (Get-Service -DisplayName '*Integration Client Service*').Count | |
# Count folders on the E drive location -- hope all the servers have ICs installed here | |
$InstallationFoldersOnDriveE = (Get-ChildItem -Path 'E:\SoftwareInstallation\' -Directory).Count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var decodeEntities = (function() { | |
// this prevents any overhead from creating the object each time | |
var element = document.createElement('div'); | |
function decodeHTMLEntities (str) { | |
if(str && typeof str === 'string') { | |
// strip script/html tags | |
str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, ''); | |
str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, ''); | |
element.innerHTML = str; | |
str = element.textContent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/11563554/how-do-i-detect-xml-parsing-errors-when-using-javascripts-domparser-in-a-cross | |
function parseXml(xmlString) { | |
var parser = new DOMParser(); | |
// cleanup Xml | |
xmlString = cleanupXml(xmlString); | |
// attempt to parse the passed-in xml | |
var dom = parser.parseFromString(xmlString, 'application/xml'); | |
if(isParseError(dom)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021 | |
* Adds html console to webpage. Especially useful for debugging JS on mobile devices. | |
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear' | |
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d) | |
* Licensed under the MIT license | |
* | |
* Changelog: | |
* 1.3.8 | |
* - fixed bug when logging numbers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utcDatetime = "01/12/2022 07:57 PM" | |
var options = {day: '2-digit', month: '2-digit', year: '2-digit', hour: '2-digit', minute:'2-digit' }; | |
var myDateTime = new Date(utcDatetime + ' UTC').toLocaleString("en-US",options) | |
// myDateTime : 01/12/22, 02:57 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/15304657 | |
// https://stackoverflow.com/questions/1091372/getting-the-clients-time-zone-and-offset-in-javascript | |
// With Options | |
var options = {timeZoneName:'short'}; | |
new Date().toLocaleString('en-US', options).toString().match(/([A-Z]){3}/)[0] | |
// Without Options | |
new Date().toString().match(/\(([A-Za-z\s].*)\)/)[1] |