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
export const downloadData = async ( | |
fileName: string, | |
data: object | string | |
): Promise<void> => { | |
const stringData = typeof data === 'string' ? data : JSON.stringify(data); | |
try { | |
const dataBlob = new Blob([stringData], { type: 'text/json' }); | |
const url = URL.createObjectURL(dataBlob); | |
const link = document.createElement('a'); | |
link.href = url; |
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: Test | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
cypress: | |
needs: [build, check_labels] | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ needs.check_labels.outputs.is_cd == '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
#!/usr/bin/env node | |
const { exec } = require('child_process') | |
console.log('Starting Test. Total approx test time: 1 minute'); | |
exec('npm run test', { cwd: __dirname }, (error, stdout, stderr) => { | |
if (error) { | |
console.log(`error: ${error.message}`) | |
return | |
} |
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
#!/usr/bin/env node | |
const { execSync } = require("child_process"); | |
const fs = require("fs"); | |
const glob = require("glob"); | |
const open = require("open"); | |
const [, , filePath] = process.argv; | |
if (!filePath) { | |
console.error("File path must be present as first argument."); | |
process.exit(1); |
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
javascript:((() => {var main=document.querySelector("main");const getEl=()=>document.querySelector('[data-testid="sidebarColumn"]');var obsv=new MutationObserver(e=>{var t=getEl();main.contains(t)&&t.remove()});obsv.observe(main,{subtree:!0,childList:!0});var el=getEl();el&&el.remove()})()); |
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
// app business logic code here | |
const {context} = require('./context'); | |
module.exports = () => { | |
// I'm inside a single lambda invocation! | |
context.iopipe.log('wow'); | |
} |
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 iopipe = require('@iopipe/core'); | |
const eventInfoPlugin = require('@iopipe/event-info'); | |
const tracePlugin = require('@iopipe/trace'); | |
module.exports = iopipe({ | |
plugins: [ | |
tracePlugin(), | |
eventInfoPlugin() | |
] | |
}); |
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 iopipeLib = require('iopipe'); | |
const profiler = require('@iopipe/profiler'); | |
const iopipe = iopipeLib({ | |
token: 'TOKEN_HERE', | |
plugins: [profiler({ enabled: true })] | |
}); | |
exports.handler = iopipe((event, context) => { | |
context.succeed('Whoomp there it is!') | |
}); |
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 Perf = require('performance-node'); | |
const timeline = new Perf(); | |
timeline.mark('ai-start'); | |
runMachineLearning(); | |
timeline.mark('ai-end'); | |
timeline.measure('ai-measure', 'ai-start', 'ai-end'); | |
const myMeasure = timeline.getEntriesByName('ai-measure')[0]; | |
// {name: 'ai-measure', startTime: 1.2, duration: 10.5, entryType: 'measure'} |
NewerOlder