Skip to content

Instantly share code, notes, and snippets.

View coreylight's full-sized avatar
🚚
Up and up

Corey Light coreylight

🚚
Up and up
View GitHub Profile
@coreylight
coreylight / index.js
Last active July 26, 2021 17:10
Mastery auth network test
#!/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
}
@coreylight
coreylight / test.yml
Created January 3, 2022 20:18
Cypress test.yml snippet
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' }}
@coreylight
coreylight / index.ts
Created April 12, 2022 17:14
JS client download data on the fly
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;