- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone [email protected]:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
| { | |
| "scripts": { | |
| "start": "node webdriverjs-set-binary" | |
| }, | |
| "dependencies": { | |
| "selenium-webdriver": "^3.6.0" | |
| }, | |
| "engines": { | |
| "node": ">=8", | |
| "npm": ">=6" |
<hash> with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with httpsgit clone https://gist.github.com/.git mygist
| 'use strict'; | |
| const gulp = require('gulp'); | |
| gulp.task('copy', () => { | |
| return gulp | |
| .src('./hello.js') | |
| .pipe(gulp.dest('./copy/')); | |
| }); |
| 'use strict'; | |
| /** | |
| * Re-require a module. | |
| * | |
| * @param {String} path - The module path. | |
| * @return {*} - The module export. | |
| */ | |
| module.exports = function rerequire(path) { | |
| try { |
| 'use strict'; | |
| /** | |
| * Module dependencies. | |
| */ | |
| const webdriver = require('selenium-webdriver'); | |
| /** | |
| * Run clients in parallel and set cookie. | |
| * https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/example/parallel_flows.js |
| 'use strict'; | |
| /** | |
| * Module dependencies. | |
| */ | |
| const webdriver = require('selenium-webdriver'); | |
| /** | |
| * Build driver. | |
| */ |
| 'use strict'; | |
| /** | |
| * Module dependencies. | |
| */ | |
| const webdriver = require('selenium-webdriver'); | |
| /** | |
| * Open each driver in parallel. | |
| * |
| 'use strict'; | |
| // this will not break and log "foo" | |
| foo(); | |
| // function declaration will be hoisted to the top | |
| // http://stackoverflow.com/questions/7609276/javascript-function-order-why-does-it-matter#answer-7610883 | |
| export function foo() { | |
| console.log('foo'); | |
| } |
| # set the base image to Debian | |
| # https://hub.docker.com/_/debian/ | |
| FROM debian:latest | |
| # replace shell with bash so we can source files | |
| RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
| # update the repository sources list | |
| # and install dependencies | |
| RUN apt-get update \ |