Skip to content

Instantly share code, notes, and snippets.

View AndrewLeedham's full-sized avatar
👋

Andrew Leedham AndrewLeedham

👋
View GitHub Profile
@AndrewLeedham
AndrewLeedham / cypress-debug.log
Created September 18, 2021 00:26
Cypress error log
cypress:server:reporter got mocha event 'test:before:run' with args: [ { id: 'r2', order: 1, title: 'switches the video on different viewports', body: 'function () {\n' + ' cy.mobile();\n' + ' cy.mount( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shared_XDSInternalWrapper__WEBPACK_IMPORTED_MODULE_0__["default"], {\n' + ' children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Video_Video__WEBPACK_IMPORTED_MODULE_1__.Video, {\n' + ' src: {\n' + " mobile: '/__cypress/src/videos/600x600.mp4',\n" + " tablet: '/__cypress/src/videos/1200x450.mp4'\n" + ' },\n' + ' ratio: {\n' + ' mobile: [1, 1],\n' + ' tablet: [1200, 450]\n' + ' }\n' + ' })\n' + ' }));\n' + " cy.get('video > source').should('have.attr', 'src', '/__cypress/src/videos/600x600.mp4');\n" + " cy.get('video').should('have.length', 1);\n" + ' cy.desktop();\n' + " cy.get('video').should('have.length', 1);\n" + " cy.get('video > source').should('hav
@AndrewLeedham
AndrewLeedham / dependabot-manager.js
Created December 12, 2020 16:42
CLI for bulk merging dependabot PRs
const path = require('path');
require("dotenv").config({path: path.join(__dirname, '.env')});
const yargs = require('yargs');
const prompts = require('prompts');
const chalk = require('chalk');
const ora = require('ora');
const { Octokit } = require("@octokit/rest");
const octokit = new Octokit({
auth: process.env.GITHUB_PERSONAL_ACCESS_TOKEN
});
/**
* Converts an ArrayBuffer to a String.
*
* @param buffer - Buffer to convert.
* @returns String.
*/
export default function arrayBufferToString(buffer: ArrayBuffer): string {
return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer)));
}