View Evict.workflow.js
This file contains 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 app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
function run(input, parameters) { | |
try { | |
if (input.length > 1) throw new Error('Has to be one folder'); | |
let folder = input['0'].toString(); | |
if (!folder) throw new Error('No folder'); |
View index.ts
This file contains 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
/** | |
* Task is just an async function that accepts no arguments and returns a promise with result | |
* Example: `async () => new Promise(...)` | |
*/ | |
export const sequentialBatches = async <T>(tasks: (() => Promise<T>)[], maxConcurrency = 100): Promise<T[]> => { | |
const batches = tasks.reduce((res, task, index) => { | |
const batchIndex = Math.floor(index / maxConcurrency); | |
res[batchIndex] = res[batchIndex] || []; | |
res[batchIndex].push(task); | |
return res; |
View MouseWheelDrag.js
This file contains 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
/** | |
* @author Jacky Nguyen | |
* @author Kirill Konshin (patched version for Sencha Touch 2.2.x) | |
* @class Common.MouseWheelDrag | |
* | |
* Ext.Loader.setPath('Common', '/path/to/your/app/common'); | |
* | |
* Ext.application({ | |
* // ... | |
* eventPublishers: { |