You may want to employ the Parcel backed boilerplate that implements the solution described below.
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
# Turn on Notifications | |
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref | |
# Show Desktop | |
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder" | |
# Show all windows | |
tell application "System Events" | |
set visible of (every process) to true | |
end tell |
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
// .filter(Boolean) | |
// .fitler to unique values | |
const fruit = ['Apple', 'Banana', 'Apple', 'Orange'] | |
console.log(Array.from(new Set(fruit))) | |
const unique = (element, index, fullArray) => fullArray.indexOf(element) === index | |
console.log(fruit.filter(unique)) | |
/* |