Description | Exception |
---|---|
Decline | \Stripe\Exception\CardException |
Too many requests made to the API too quickly | \Stripe\Exception\RateLimitException |
Invalid parameters were supplied to Stripe's API | \Stripe\Exception\InvalidRequestException |
Authentication with Stripe's API failed | \Stripe\Exception\AuthenticationException |
Network communication with Stripe failed | \Stripe\Exception\ApiConnectionException |
Display a very generic error to the user | \Stripe\Exception\ApiErrorException |
This file contains 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
Run git push heroku master | |
git push heroku master | |
shell: /usr/bin/bash -e {0} | |
remote: | |
remote: ! Push rejected, source repository is a shallow clone. Unshallow it with `git fetch --all --unshallow` and try pushing again. | |
remote: | |
To https://git.heroku.com/***.git | |
! [remote rejected] master -> master (shallow update not allowed) | |
error: failed to push some refs to 'https://git.heroku.com/***.git' | |
Error: Process completed with exit code 1. |
This file contains 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
jobs: | |
custom-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Heroku login credentials | |
run: | |
This file contains 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
jobs: | |
heroku-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Deploy to Heroku | |
uses: akhileshns/heroku-deploy@v3.12.12 | |
with: | |
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} |
This file contains 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
/** | |
* Evaluate XPath expression. | |
* | |
* @param {string} xpathExpression - XPath expression. | |
* @param {HTMLElement} [contextNode=document] - Context node for the query. | |
* @returns {HTMLElement[]} | |
*/ | |
function evaluateXPath(xpathExpression, contextNode = document) { | |
const result = document.evaluate( | |
xpathExpression, |
This file contains 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 KEY_CODE = { | |
ARROW_DOWN: 40, | |
BACKSPACE: 8, | |
ENTER: 13, | |
}; | |
/** | |
* Dispatch keydown event. | |
* | |
* @param {number} keyCode |
This file contains 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 { createHash } = require('crypto'); | |
function hash(string) { | |
return createHash('sha256').update(string).digest('hex'); | |
} |
This file contains 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
async function hash(string) { | |
const utf8 = new TextEncoder().encode(string); | |
const hashBuffer = await crypto.subtle.digest('SHA-256', utf8); | |
const hashArray = Array.from(new Uint8Array(hashBuffer)); | |
const hashHex = hashArray | |
.map((bytes) => bytes.toString(16).padStart(2, '0')) | |
.join(''); | |
return hashHex; | |
} |
This file contains 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 spy = jest.fn(); // or `jasmine.createSpy()` | |
const testWidth = 420; | |
beforeAll(() => { | |
window.addEventListener('resize', spy); | |
}); | |
it('does not fire resize event by default', () => { | |
expect(spy).not.toHaveBeenCalled(); | |
expect(window.innerWidth).not.toBe(testWidth); |