Skip to content

Instantly share code, notes, and snippets.

View alibalbars's full-sized avatar

Ali Balbars alibalbars

View GitHub Profile
@alibalbars
alibalbars / test3.js
Created June 23, 2025 13:34
test3.js
console.log('--- Running Fetch Translations Script ---');
const fs = require('fs');
const path = require('path');
const {execSync} = require('child_process');
const fetchScriptPath = path.resolve(process.cwd(), 'scripts/locale/fetch-translations.js');
const MAGENTA = '\x1b[35m';
const RESET = '\x1b[0m';
const RED = '\x1b[38;5;197m';
@alibalbars
alibalbars / test2.js
Last active May 15, 2025 06:04
test2.js
console.log('--- Running Fetch Translations Script ---');
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const translationsFilePath = path.resolve(process.cwd(), 'src/locales/messages.en-us.json');
const fetchScriptPath = path.resolve(process.cwd(), 'scripts/locale/fetch-translations.js');
const MAGENTA = '\x1b[35m';
const RESET = '\x1b[0m';
@alibalbars
alibalbars / test.js
Last active May 14, 2025 19:26
test.js
console.log('--- Running Fetch Translations Script ---');
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const translationsFilePath = path.resolve(process.cwd(), 'src/locales/messages.en-us.json');
const fetchScriptPath = path.resolve(process.cwd(), 'scripts/locale/fetch-translations.js');
const MAGENTA = '\x1b[35m';
const RESET = '\x1b[0m';
npx babel src.js --out-file output.js
npx babel --version
npm run babel --version
yarn babel --version
yarn run babel --version
{
"presets":["@babel/env"]
}
@alibalbars
alibalbars / babel.config.json
Last active August 25, 2021 12:31
babel-config
{
"presets": ["env"]
}
new Promise(function (resolve, reject) {
setTimeout(() => {
try{
noSuchAFunction(); // not defined
} catch(error) {
reject(error);
}
}, 1000);
}).catch(e => console.log('Something went wrong!'));
new Promise(function(resolve, reject) {
setTimeout(() => {
reject(new Error("Whoops!")); (*)
}, 1000);
}).catch(alert);
new Promise(function(resolve, reject) {
setTimeout(() => {
throw new Error("Whoops!");
}, 1000);
}).catch(alert);