Skip to content

Instantly share code, notes, and snippets.

@ericlewis
ericlewis / .directions.md
Last active October 25, 2023 18:25
A conversational chatbot experience.

Prerequisites

  • API key for OpenAI.
  • API key for Picovoice
  • API key for ElevenLabs
  • mpg123 installed
  • node 18+

Directions

  • git clone https://gist.github.com/ericlewis/ccd3f0b7a17fcbe2473121a473082c8f
  • edit .env with your keys
@alexanderson1993
alexanderson1993 / copyToClipboard.ts
Created January 28, 2021 21:43
A component that copies some text to the clipboard when it is clicked.
import * as React from "react";
const CopyToClipboard:React.FC<{text:string} & React.HTMLAttributes<HTMLButtonElement>> = ({text, ...props}) => {
const copyToClipboard = (event:React.MouseEvent<HTMLButtonElement>, str:string) => {
const el = Object.assign(document.createElement('textarea'),{value:str});
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
@fson
fson / rapid-prototyping-with-relay.md
Created October 18, 2015 20:08
Rapid prototyping with Relay (Reactive 2015 lightning talk proposal)

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

Rapid prototyping with Relay

Relay makes data fetching in React apps simpler, by letting you declare the data needs of your components instead of writing complex imperative code. React, Relay, GraphQL and the other complementary tools are changing how apps are built.

@ericvicenti
ericvicenti / gist:5617580
Created May 21, 2013 05:06
node.js supervisor setup
[program:appname-0]
command=/usr/bin/node /appname
process_name: appname-0
directory=/appname/
environment=NODE_ENV='prod'
user=user
autostart=true
autorestart=true
redirect_stderr=False
stopwaitsecs=30