Skip to content

Instantly share code, notes, and snippets.

View KernelFolla's full-sized avatar

Marino Di Clemente KernelFolla

  • KF Informatica
  • Trani, Italy
View GitHub Profile
@KernelFolla
KernelFolla / gist:2647d7c644dce10913c592b1708f3a1e
Created October 4, 2023 17:46
playwright mock getusermedia
/**
* see https://github.com/theopenwebjp/get-user-media-mock
*/
import { Page } from '@playwright/test';
export const mockUserMedia = async (page: Page) => {
// eslint-disable-next-line sonarjs/cognitive-complexity
return await page.addInitScript(() => {
/* eslint-disable @typescript-eslint/ban-ts-comment */
/**
@KernelFolla
KernelFolla / capifony.sh
Last active August 17, 2017 21:52
run legacy capifony using docker, works on osx and linux
#!/bin/bash
IMAGE="mjanser/capifony"
CURRDIR=$(pwd)
if [ "$(uname)" == "Darwin" ]; then
# under Mac OS X platform
command -v jq >/dev/null 2>&1 || { echo >&2 "please install jq with \"brew install jq\" or \"port install jq\""; exit 1; }
docker pull $IMAGE
ENTRYPOINT=$(docker inspect $IMAGE | jq -r '.[0].ContainerConfig.Entrypoint[0]')