Skip to content

Instantly share code, notes, and snippets.

View mkbctrl's full-sized avatar

Mikołaj Koropecki mkbctrl

View GitHub Profile
@jsbeaudry
jsbeaudry / ElevenLabsTextToSpeechAPI.js
Last active July 10, 2023 20:15
Generate top-quality spoken audio in any voice, style and language with the most advanced Text to Speech tool ever. Our AI model renders human intonation and inflections with unprecedented fidelity and it adjusts delivery based on context.
const callElevenLabsTextToSpeechAPI = async (text) => {
if (!text) return "Text parameter can't be null";
const [rachel, anntoni] = ["21m00Tcm4TlvDq8ikWAM", "ErXwobaYiN019PkySvjV"];
const url = `https://api.elevenlabs.io/v1/text-to-speech/${rachel}`;
const apiKey = process.env.ELEVENLABS_KEY;
const headers = {
@j-bullard
j-bullard / App.tsx
Created July 4, 2021 07:15
Headless UI with React Hook Forms
import "./styles.css";
import { Person } from "./types";
import { Listbox } from "./listbox/listbox";
import { useForm } from "react-hook-form";
const people: Person[] = [
{ id: 1, name: "Durward Reynolds", unavailable: false },
{ id: 2, name: "Kenton Towne", unavailable: false },
{ id: 3, name: "Therese Wunsch", unavailable: false },
{ id: 4, name: "Benedict Kessler", unavailable: true },
@Geoff-Ford
Geoff-Ford / composing-software.md
Last active September 12, 2024 18:03
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@vipickering
vipickering / closestNumberArray.js
Created September 13, 2013 15:42
Javascript: Find The Closest Number In Array To A Specific Value
var array = [];
function closest(array,num){
var i=0;
var minDiff=1000;
var ans;
for(i in array){
var m=Math.abs(num-array[i]);
if(m<minDiff){
minDiff=m;