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
| stripe.plans.create( | |
| { | |
| amount: 1000, | |
| name: "A monthly membership", | |
| id: "monthly-membership", | |
| interval: "month", | |
| currency: "gbp" | |
| }, | |
| { |
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
| stripe.customers.create({ | |
| description: "A new member, called Linda!", | |
| source: "tok_visa" | |
| },{ | |
| stripe_account: req.body.account | |
| }); |
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
| stripe.subscriptions.create({ | |
| customer: "your-customers-id", | |
| plan: "monthly-membership", | |
| application_fee_percent: 5 | |
| }, { | |
| stripe_account: req.body.account | |
| }) |
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
| describe('GIVEN I am not an admin user', function () { | |
| describe('WHEN Navigate to the page /admin ', function () { | |
| it('THEN I see a warning box stating: "You do not have access to this page" ', () => { | |
| Page.navigate('/admin') | |
| expect(Page.elementContains('#error-message', 'You do not have access to this page')).toBeTrue(); | |
| }); | |
| }); | |
| }); |
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
| Array.prototype.reduceLou = function( func, start = 0 ){ | |
| let state = start; | |
| for(let i = 0; i < this.length; i++) { | |
| state = func(state, this[i]); | |
| } | |
| return state; |
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 db = require('../../database/db.js'); | |
| // The following would be library code, touched barely ever | |
| const _executeTransaction = async(transaction) => { | |
| try { | |
| return await db.tx(transaction); | |
| } catch (e) { | |
| console.log(e); | |
| // Handle DB error | |
| } |
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: | |
| function createCookie(name,value,days) { | |
| if (days) { | |
| var date = new Date(); | |
| date.setTime(date.getTime() + (days * 24 * 60 * 60 *1000)); | |
| var expires = "; expires=" + date.toGMTString(); | |
| } else { | |
| var expires = ""; |
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
| var toCurry = function (func) { | |
| return function (val) { | |
| func(val); | |
| } | |
| }; | |
| toCurry(console.warn)('sdfsdf'); | |
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
| class Initialisation { | |
| constructor() { | |
| this.aFunctionThatThrowsImmediately(); | |
| this.aFunctionThatThrowsLater(); | |
| } | |
| // Fake stuff to show the return values of module | |
| aFunctionThatThrowsImmediately() { | |
| console.log(this.errorCallback()); // error thrown, but platform not set | |
| } |
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: Make artifact directory | |
| run: mkdir -p ./artifacts/${{ github.repository }} | |
| - name: Create Zip File | |
| uses: montudor/action-zip@v0.1.0 | |
| with: | |
| args: zip -r ./artifacts/${{ github.repository }}/${{ github.sha }}.zip ./src | |
| - name: Push Zip to S3 | |
| uses: jakejarvis/s3-sync-action@v0.3.1 |