Skip to content

Instantly share code, notes, and snippets.

View jsbeaudry's full-sized avatar

Beaudry Jean Sauvenel jsbeaudry

  • Parkour studio
  • Port-au-prince, Haiti
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 = {
@jsbeaudry
jsbeaudry / OpenAPI-React-Native
Created March 7, 2023 01:47
Server-Sent Events (SSE) is a standard protocol for sending real-time updates from the server to the client. In this article, we will explain how to implement Server-Sent Events for React Native by using the react-native-sse and react-native-url-polyfill/auto.
//1
yarn add react-native-sse
yarn add react-native-url-polyfill
//2
import EventSource from "react-native-sse";
import "react-native-url-polyfill/auto";
//3
const OPENAI_KEY = '<your-openai-api-key>';
@jsbeaudry
jsbeaudry / Fiat.sol
Last active August 21, 2023 16:57
Create a Bank on the blockchain
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Fiat is ERC20, ERC20Burnable, Ownable {
constructor() ERC20("Fiat", "FIAT") {
_mint(msg.sender, 1000 * 10 ** decimals());