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 genericFunction(a: number) { | |
| class InnerClass { | |
| property = a | |
| } | |
| return InnerClass | |
| } | |
| export { genericFunction } |
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
| { | |
| extends: ['config:base', 'schedule:weekly', 'group:allNonMajor'], | |
| labels: ['dependencies'], | |
| pin: false, | |
| rangeStrategy: 'bump', | |
| node: false, | |
| packageRules: [{ depTypeList: ['peerDependencies'], enabled: false }], | |
| } |
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
| { | |
| "global": { | |
| "ask_for_confirmation_before_quitting": true, | |
| "check_for_updates_on_startup": true, | |
| "show_in_menu_bar": false, | |
| "show_profile_name_in_menu_bar": false, | |
| "unsafe_ui": false | |
| }, | |
| "profiles": [ | |
| { |
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
| async function waitUntil<T>( | |
| flag: (...args: any[]) => boolean, | |
| callback: (...args: any[]) => T, | |
| args: any[] = [], | |
| time: number = 50 | |
| ): Promise<T> { | |
| return new Promise(async resolve => | |
| flag() ? resolve(await callback(...args)) : setTimeout(() => this.waitUntil(flag, callback, args, time), time) | |
| ) | |
| } |
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
| import * as progress from 'cli-progress' | |
| async function progressPromises<T>(promises: Array<Promise<T>>, title: string): Promise<Array<T>> { | |
| const bar = new progress.Bar({ | |
| format: title + ' |' + colors.cyan('{bar}') + '| {percentage}% || {value}/{total} Chunks || Speed: {speed}', | |
| barCompleteChar: '\u2588', | |
| barIncompleteChar: '\u2591', | |
| hideCursor: true, | |
| }) | |
| bar.start(promises.length, 0, { speed: 'N/A' }) |
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
| async function asyncChunkRequest<Input, Output>( | |
| inputs: Array<Input>, | |
| method: (inputs: Array<Input>, ...args: unknown[]) => Array<Output> | Promise<Array<Output>>, | |
| args: unknown[] = [], | |
| chunkSize: number = 100 | |
| ): Promise<Array<Output>> { | |
| const results: Array<Output> = [] | |
| for (const index in Array.from({ length: Math.ceil(inputs.length / chunkSize) })) { | |
| const chunk = inputs.slice(Number(index) * chunkSize, (Number(index) + 1) * chunkSize) | |
| const chunkResult = await method(chunk, ...args) |
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
| version: '3' | |
| services: | |
| drivebrowser: | |
| image: hurlenko/filebrowser | |
| ports: | |
| - 8282:8080 | |
| volumes: | |
| - ./Desktop:/data/Desktop | |
| - ./Music:/data/Music |
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
| name: CI/CD | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: |
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
| /* | |
| <summary>Beautiful Node Addon Thread Worker</summary> | |
| */ | |
| template <class ReturnType, class... Types> struct ArgsWrapper { | |
| template <class C, Types... args> | |
| class CoreWorker : public Napi::AsyncWorker { | |
| public: | |
| CoreWorker(Napi::Env &env, C *core, function<ReturnType(C &)> func) | |
| : Napi::AsyncWorker(env), deferred(Napi::Promise::Deferred::New(env)), | |
| core(core), func(func) {} |
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 UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | |
| const path = require('path') | |
| module.exports = (env, argv) => ({ | |
| entry: { | |
| index: './js/index.js' | |
| }, | |
| performance: { | |
| hints: false | |
| }, |
NewerOlder