Skip to content

Instantly share code, notes, and snippets.

View aslushnikov's full-sized avatar
🚀
Going through all the e-mails and notifications

Andrey Lushnikov aslushnikov

🚀
Going through all the e-mails and notifications
View GitHub Profile
import pptr from 'puppeteer';
import http from 'http';
const createServer = (port, handler) => {
const server = http.createServer(handler);
return new Promise(x => server.listen(port, x));
};
// 1. Create a server that serves the main page.
// NOTE: this page will create an EventSource to the `/sse` endpoint, but this server DOES NOT
@aslushnikov
aslushnikov / README.md
Last active July 3, 2022 18:11
/etc/os-release list for popular distributions

Here is a list of os-release values in all kinds of different distributions.

NAME VERSION ID VERSION_ID PLATFORM_ID VARIANT VARIANT_ID BUILD_ID ID_LIKE PRETTY_NAME HOME_URL SUPPORT_URL BUG_REPORT_URL VERSION_CODENAME UBUNTU_CODENAME PRIVACY_POLICY_URL ANSI_COLOR LOGO CPE_NAME DOCUMENTATION_URL REDHAT_BUGZILLA_PRODUCT REDHAT_BUGZILLA_PRODUCT_VERSION REDHAT_SUPPORT_PRODUCT REDHAT_SUPPORT_PRODUCT_VERSION CENTOS_MANTISBT_PROJECT CENTOS_MANTISBT_PROJECT_VERSION
Ubuntu 14.04 Ubuntu 14.04.6 LTS, Trusty Tahr ubuntu 14.04 debian Ubuntu 14.04.6 LTS http://www.ubuntu.com/ http://help.ubuntu.com/ http://bugs.launchpad.net/ubuntu/
Ubuntu 16.04 Ubuntu 16.04.7 LTS (Xenial Xerus) ubuntu 16.04 debian Ubuntu 16.
task1: setimmediate
task2: setimmediate
task1: promise resolved
const playwright = require('.');
const path = require('path');
const fs = require('fs');
(async () => {
const browser = await playwright.chromium.launch({
_videosPath: __dirname,
});
const context = await browser.newContext({
_recordVideos: {width: 320, height: 240},
@aslushnikov
aslushnikov / win-compile-ffmpeg.md
Last active September 16, 2022 07:35
Windows: Compiling FFMPEG 4.3.1 with only LIBVPX and a few filters

Windows: Compiling FFMPEG 4.3.1 with only LIBVPX and a few filters

My goal was to compile minimal FFMPEG binary on Windows with the following properties:

  • is statically-linked
  • has jpeg decoder
  • has vp8 encoder
  • has a few enabled filters
  • both win32 and win64

Here's my log as of September 3, 2020.

@aslushnikov
aslushnikov / cross-compiling-ffmpeg.md
Last active September 4, 2020 07:41
cross-compiling ffmpeg for windows
@aslushnikov
aslushnikov / compile-ffmpeg-on-mac-os-10-15.md
Last active September 2, 2020 00:44
Compiling ffmpeg on Mac OS 10.15

Compiling minimal FFMPEG on Mac OS 10.15

Recording my steps to build minimal ffmpeg on September 1, 2020.

I mostly followed steps at https://trac.ffmpeg.org/wiki/CompilationGuide/macOS

  1. Clone repo & checkout release tag (we're building release v4.3.1)
~$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
aslushnikov:~/prog/playwright(master)$ FFPATH=$FF xvfb-run --auto-servernum npm run ftest
> playwright-internal@1.3.0-post ftest /home/aslushnikov/prog/playwright
> cross-env BROWSER=firefox node test/runner test/
(node:5569) UnhandledPromiseRejectionWarning: /home/aslushnikov/prog/playwright/test/.browsercontext-cookies.spec.ts.swp:1
b0VIM 8.0
^^^
SyntaxError: Unexpected number
function callMethod(methods, attributes, callback, methodName, methodValue) {
methods = new Map(methods);
methods.set(methodName, methodValue);
return createProxy({methods, attributes}, callback);
}
function setAttribute(methods, attributes, callback, attributeName) {
attributes = new Map(attributes);
attributes.set(attributeName, true);
return createProxy({methods, attributes}, callback);
> playwright-internal@1.3.0-post ftest /Users/aslushnikov/prog/playwright
> cross-env BROWSER=firefox jest "page-wait-for-navigation.spec.js"
console.error
Using executable at /Users/aslushnikov/firefox/obj-build-playwright/dist/Nightly.app/Contents/MacOS/firefox
73 | executablePath = process.env.WKPATH;
74 | if (executablePath)
> 75 | console.error(`Using executable at ${executablePath}`);