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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>com.apple.security.app-sandbox</key> | |
<true/> | |
<key>com.apple.security.application-groups</key> | |
<string>APPLE_GROUP_STRING</string> | |
<key>com.apple.security.files.user-selected.read-write</key> | |
<true/> |
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
const settings = require('electron-settings'); | |
dialog | |
.showOpenDialog(mainWindow, { | |
properties: ['openDirectory'], | |
securityScopedBookmarks: true, | |
}) | |
.then(({ canceled, filePaths, bookmarks }) => { | |
// If the dialog was canceled or no directory/file selected we don't want to do anything | |
if (canceled || filePaths.length === 0) { |
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
function numberToLetters(index: number): string { | |
const charLimit: number = 26; | |
if (index > charLimit) { | |
if (index % charLimit === 0) { | |
return `${numberToLetters((index / charLimit) - 1)}${numberToLetters(charLimit)}`; | |
} else { | |
return `${numberToLetters(Math.trunc(index / charLimit))}${numberToLetters(index % charLimit)}`; | |
} | |
} else { | |
const a: number = 'A'.charCodeAt(0); |
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
/** | |
* Helper class for easier registering and deregistering of events | |
* | |
* This is especially great if you need to register/deregister ES6 arrow functions. Those are pretty ugly to handle. | |
* | |
* Example: | |
* Old: | |
* const myMethod = () => {} // do anything | |
* const myMethodListener = myMethod.bind(this); | |
* |