/** Delete Job */ function sampleDeleteJob(projectId, tenantId, jobId) { const client = new talent.JobServiceClient(); // const projectId = 'Your Google Cloud Project ID'; // const tenantId = 'Your Tenant ID (using tenancy is optional)'; // const jobId = 'Company ID'; const formattedName = client.jobPath(projectId, tenantId, jobId); client.deleteJob({name: formattedName}).catch(err => { console.error(err); }); console.log(`Deleted job.`); }
this.props.session.gatewayClient .forgotPassword(this.state.email) .then(() => this.setState({ success: true, forgotInProgress: false })) .catch(e => { console.log(e); this.setState({ success: true, forgotInProgress: false }); });
async get(url, query) { const key = `get ${url}`; if (!responses[key]) { console.log(`${key} not found in demo.json`); throw new Error(`${key} not found in demo.json`); } return Promise.resolve(responses[key]); }
handleError(error) { if (error.code === 'ECONNREFUSED') { console.error( `Connection refused at ${error.address}${error.port ? `:${error.port}` : ''}. ` + 'Check these values in config.js and ensure that rTorrent is running.', ); } this.clearRequestQueue(); if (this.onCompleteFn) { this.onCompleteFn(null, error); } }
setTimeout(() => { try { requestAnimationFrame(window.mods.globe._animate); } catch(e) { // We probably got caught in a theme change. Print it out but everything should keep running fine. console.warn(e); } }, 1000 / 30);
groupEnd() { if (this.groupName) { console.groupEnd(); } }
const log = data => { if (process.env.DEBUG) { console.log(data); } }
const formatSource = async () => { console.log(chalk.reset('Formatting source files...')); try { const sourceFilePaths = await getSourceFilePaths(); const formattedPaths = await Promise.all(sourceFilePaths.map(filePath => formatFile(filePath, filePath))); console.log(chalk.green(`Formatted ${formattedPaths.length} files.`)); } catch (error) { console.log(chalk.red('Problem formatting file:\n'), chalk.reset(error)); process.exit(1); } }
this.props.session.gatewayClient .forgotPassword(this.state.email) .then(() => this.setState({ success: true, forgotInProgress: false })) .catch(e => { console.log(e); this.setState({ success: true, forgotInProgress: false }); });
async post(url, query) { const key = `post ${url}`; if (!responses[key]) { console.log(`${key} not found in demo.json`); throw new Error(`${key} not found in demo.json`); } return Promise.resolve(responses[key]); }
async patch(url, query) { const key = `patch ${url}`; if (!responses[key]) { console.log(`${key} not found in demo.json`); throw new Error(`${key} not found in demo.json`); } return Promise.resolve(responses[key]); }
groupEnd() { if (this.groupName) { console.groupEnd(); } }