Skip to content

Instantly share code, notes, and snippets.

diachedelic

Block or report user

Report or block diachedelic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wdio.log
yarn run v1.15.2
$ wdio wdio.conf.js
Execution of 1 spec files started at 2019-07-30T01:06:46.198Z
2019-07-30T01:06:46.203Z DEBUG @wdio/utils:initialiseServices: initialise wdio service "chromedriver"
2019-07-30T01:06:46.251Z INFO @wdio/cli:Launcher: Run onPrepare hook
Starting ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770@{#1003}) on port 4444
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
View wdio.log
$ git clone git@github.com:diachedelic/wdio-repros.git &&
> cd wdio-repros &&
> git checkout sync-promises &&
> npm i &&
> npm test
Cloning into 'wdio-repros'...
remote: Enumerating objects: 112, done.
remote: Counting objects: 100% (112/112), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 112 (delta 49), reused 96 (delta 33), pack-reused 0
View wdio.log
$ npm test
> webdriverio-typescript-boilerplate@1.0.1 test /Users/diachedelic/Code/wdio-repros
> npm run prettier && ./node_modules/.bin/wdio wdio.conf.js
> webdriverio-typescript-boilerplate@1.0.1 prettier /Users/diachedelic/Code/wdio-repros
> prettier --write ./test/**/*.ts ./models/**/*.ts ./pages/**/*.ts
models/index.ts 331ms
@diachedelic
diachedelic / jpeg_quality_vs_filesize.tsv
Created Jun 20, 2019
quality vs filesize resulting from `canvas.toBlob(cb, 'image/jpeg', quality)`
View jpeg_quality_vs_filesize.tsv
0 0.008210771260531026
0.01 0.008210771260531026
0.02 0.008216896670125255
0.03 0.00887707970416994
0.04 0.010482277318390965
0.05 0.01241246194163914
0.06 0.014545125382029886
0.07 0.01679247010204592
0.08 0.01906057315457573
0.09 0.021325273201775415
@diachedelic
diachedelic / capacitor_write_big_file.js
Created Jun 19, 2019
How to write a large blob to the filesystem without running out of memory
View capacitor_write_big_file.js
// encodes an ArrayBuffer to base64 using a web worker, instead of blocking the main thread
class Base64Encoder {
constructor() {
// keep track of messages
this._index = 0
this._resolves = {}
const onmessage = ({ data }) => {
const bytes = new Uint8Array(data.buffer)
View wdio.log
2019-04-04T00:58:07.279Z DEBUG @wdio/utils:initialiseServices: initialise wdio service "selenium-standalone"
2019-04-04T00:58:07.342Z INFO @wdio/cli:Launcher: Run onPrepare hook
2019-04-04T00:58:11.348Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio.conf.js
[0-0] 2019-04-04T00:58:11.775Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2019-04-04T00:58:11.781Z DEBUG @wdio/utils:initialiseServices: initialise wdio service "selenium-standalone"
[0-0] 2019-04-04T00:58:12.017Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2019-04-04T00:58:12.045Z INFO webdriver: [POST] http://127.0.0.1:4444/wd/hub/session
[0-0] 2019-04-04T00:58:12.045Z INFO webdriver: DATA { capabilities:
{ alwaysMatch: { browserName: 'chrome', 'goog:chromeOptions': [Object] },
firstMatch: [ {} ] },
@diachedelic
diachedelic / wdio.log
Created Feb 20, 2019
debug log for webdriverio bug
View wdio.log
2019-02-20T05:39:17.963Z INFO wdio-cli:Launcher: Run onPrepare hook
Starting ChromeDriver 2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e) on port 56951
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
2019-02-20T05:39:18.082Z INFO wdio-local-runner: Start worker 0-0 with arg: --spec,test/specs/browse-my-event.js,--baseUrl,http://localhost:8009,--port,56951,/Users/me/project/node_modules/vue-cli-plugin-e2e-webdriverio/wdio.conf.default.js
[0-0] 2019-02-20T05:39:18.242Z DEBUG wdio-config: @wdio/sync found, running tests synchronous
[0-0] 2019-02-20T05:39:18.437Z INFO wdio-local-runner: Run worker command: run
[0-0] 2019-02-20T05:39:18.530Z DEBUG wdio-local-runner:utils: initialise wdio service "chromedriver"
[0-0] 2019-02-20T05:39:18.594Z DEBUG wdio-local-runner:utils: init remote session
[0-0] 2019-02-20T05:39:18.612Z INFO webdriver: [POST] http://127.0.0.1:56951/wd/hub/session
View vue_inspect.log
{
mode: 'development',
context: '/Users/xxx/Code/xxx-xxx-toolkit',
devtool: 'cheap-module-eval-source-map',
bail: true,
node: {
setImmediate: false,
process: 'mock',
dgram: 'empty',
fs: 'empty',
@diachedelic
diachedelic / webpack.config.js
Last active Oct 2, 2019
Resolve modules which have been added using `npm link` or `yarn link`
View webpack.config.js
const fs = require('fs')
const path = require('path')
// absolute paths to all symlinked modules inside `nodeModulesPath`
// adapted from https://github.com/webpack/webpack/issues/811#issuecomment-405199263
const findLinkedModules = (nodeModulesPath) => {
const modules = []
fs.readdirSync(nodeModulesPath).forEach(dirname => {
const modulePath = path.resolve(nodeModulesPath, dirname)
@diachedelic
diachedelic / debug_npm_script_hooks.md
Created Sep 25, 2018
Debug NPM script hooks (preinstall, postinstall etc)
View debug_npm_script_hooks.md

I find it frustrating when I don't know when certain npm/yarn/yalc hooks are being run.

Just add this to the package.json for realtime notifications:

{
  "scripts": {
    "prepublish": "terminal-notifier -message 'prepublish'",
    "prepare": "terminal-notifier -message 'prepare'",
    "prepublishOnly": "terminal-notifier -message 'prepublishOnly'",
You can’t perform that action at this time.