- Add your project logo.
- Write a short introduction to the project.
- If you are using badges, add them here.
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
| #!/bin/bash | |
| # this small scripts sets all the required environment variables for Synpress | |
| # For Optimismtic Kovan | |
| # | |
| # It reads the private key from a file called SYNPRESS_PRIVATEKEY | |
| # If you're a developer don't forget to put the file SYNPRESS_PRIVATEKEY in your .gitignore ! | |
| # | |
| # Kwenta uses Synpress (a wrapper around Cypress) to run full end-to-end tests | |
| # On Linux environment this scripts must be called using ". ./synpress-env.sh" |
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
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |
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
| function getAadToken(user, password, identifier) { | |
| return puppeteer.launch({ headless: true }).then(async browser => { | |
| try { | |
| const page = await browser.newPage(); | |
| await page.goto("SITEURL"); | |
| await page.click( | |
| "LOGINBUTTON" | |
| ); |
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
| import React from 'react'; | |
| function onlyChild(children) { | |
| return Array.isArray(children) ? children[0] : children; | |
| } | |
| export function combineContext(contexts) { | |
| class Provider extends React.Component { | |
| render() { | |
| const init = this.props.children; |
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
| 'use strict' | |
| var React = require('react') | |
| var Child = React.createClass({ | |
| render: function() |
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
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |