Skip to content

Instantly share code, notes, and snippets.

@mvasin
mvasin / hello-browserstack.js
Created November 5, 2018 11:36
Hello World on BrowserStack
const {Builder, By} = require('selenium-webdriver');
const {BROWSERSTACK_USERNAME, BROWSERSTACK_KEY} = process.env;
if (!BROWSERSTACK_USERNAME || !BROWSERSTACK_KEY)
throw Error('Specify BROWSERSTACK_USERNAME and BROWSERSTACK_KEY env vars!');
const chrome = {
browserName: 'Chrome',
browser_version: '70.0',
os: 'Windows',
// Not ready yet, don't try this at home
import React, { useState } from 'react';
type Model = number;
interface AgGridMethods {
getModel: () => Model;
setModel: (model: Model) => void;
}
// POST request body to /stub BFF endpoint
interface StubSetup {
method: 'GET' | 'POST' | 'PUT' | 'DELETE'
path: string
headers: { [headerName: string]: string }
responseCode: number
responseBody: any
}
@mvasin
mvasin / transcribe.sh
Last active May 18, 2023 17:02
Transcribing audio files to text using OpenAI's Whisper model
#!/bin/sh
# A Mac utility to transcribe audio files using OpenAI's API (Whisper)
#
# Usage:
#
# $OPENAI_API_KEY='your-key-here' sh ./transcribe.sh [/path/to/the/dir/with/the/audio/files]
#
# If the path to the files is not specified, the utility will work in the current directory