Skip to content

Instantly share code, notes, and snippets.

@atharvashukla
atharvashukla / whisper-timestamps.sh
Created April 5, 2023 01:41
Printing timestamps with Whisper API call
#!/bin/bash
API_KEY="$1"
FILE_PATH="$2"
MODEL_NAME="whisper-1"
curl -X POST "https://api.openai.com/v1/audio/transcriptions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@$FILE_PATH" \
@atharvashukla
atharvashukla / random-rgb.js
Last active May 22, 2021 15:23
Randomly generates arbitrary number of unique single color png/svg images.
// HOW TO USE
// ----------
//
// Setup:
// mkdir random-rgb; cd random-rgb; npm init -y; npm i canvas; mkdir imgs;
// Then place this file (random-rgb.js) into random-rgb folder (as created above), run:
// node random-rgb.js
//
// Configuring:
//
function swap(A, i, j) {
var tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
function selectionSort(A, n) {
let i = 0
while (i < n) {
let m = i