The main command is:
git config --global core.editor "path to your editor with params"
Set up an editor and check it by making a commit:
// https://github.com/cypress-io/cypress/issues/566 | |
// https://github.com/cypress-io/cypress/issues/534 | |
// in your commands file: | |
Cypress.Commands.add('fill', { | |
prevSubject: 'element' | |
}, (subject, value) => { | |
cy.wrap(subject).invoke('val', value).trigger('input').trigger('change') | |
}); |
:root { | |
background-color: #fefefe; | |
filter: invert(100%); | |
} | |
* { | |
background-color: inherit; | |
} | |
img:not([src*=".svg"]), video { | |
filter: invert(100%); | |
} |
// example lib https://github.com/charto/cwait | |
// https://krasimirtsonev.com/blog/article/implementing-an-async-queue-in-23-lines-of-code | |
function createQueue(tasks, maxNumOfWorkers = 4) { | |
let numOfWorkers = 0; | |
let taskIndex = 0; | |
const resultData = []; | |
return new Promise(done => { | |
const handleResult = index => result => { |
axios(`${apiURL}/pdf`, { | |
method: 'GET', | |
responseType: 'blob' //Force to receive data in a Blob Format | |
}) | |
.then(response => { | |
//Create a Blob from the PDF Stream | |
const file = new Blob( | |
[response.data], | |
{type: 'application/pdf'}); | |
//Build a URL from the file |
function escapeHtml(text) { | |
var map = { | |
'&': '&', | |
'<': '<', | |
'>': '>', | |
'"': '"', | |
"'": ''' | |
}; | |
return text.replace(/[&<>"']/g, function(m) { return map[m]; }); |
import decode from 'jwt-decode'; | |
import { | |
API_BASE_URL, | |
ACCESS_TOKEN, | |
REFRESH_TOKEN, | |
ACTIVE_USER } from '../../helpers/constants.js'; | |
/** | |
* Authentification service. | |
* Performs api calls sending the required authentication headers. |
// node.js version | |
var util = require('util'); | |
var fractal = { | |
a1: { | |
b1: { | |
c: 1 | |
}, | |
b2: { | |
c: 222 |
const linkedList = { | |
toc: { | |
children: [ | |
{id: '1-1', val: '1-1', children: []}, | |
{ | |
id: '1-2', | |
val: '1-2', | |
children: [ | |
{id: '2-1', val: '2-1', children: []}, | |
{id: '2-2', val: '2-2', children: []}, |
const crypto = require('crypto') | |
const arr = new Array(200).fill('something') | |
function processChunk() { | |
if (arr.length === 0) { | |
// code that runs after the whole array is executed | |
} else { | |
console.log('processing chunk'); | |
// pick 10 items and remove them from the array | |
const subarr = arr.splice(0, 10) |