Skip to content

Instantly share code, notes, and snippets.

View hnrq's full-sized avatar
👋
How's it going?

Henrique Ramos hnrq

👋
How's it going?
View GitHub Profile
@Big-al
Big-al / Browser.ts
Created August 18, 2020 23:14
Example on how to create a puppeteer browser instance using a singleton pattern in Typescript, with error handling and performance optimizations.
Import puppeteer from 'puppeteer';
Import { LoggingService, LogLevel } from './LoggingService';
const Logger: LoggingService = LoggingService.getInstance();
export class Browser implements IBrowser {
private browser: puppeteer.Browser;
private readonly TIMEOUT: number;
private readonly USER_AGENT = 'INSERT_USERAGENT';
constructor(_timeout: number = 30000) {
@Erk-
Erk- / guide.md
Last active September 16, 2023 23:23
Play directly from spotify (or other mopidy sources)

Play directly from spotify

Intro

This guide helps you setup a configuration like: mopidy -> icecast -> listner (bot) Where you can use mopidy to play from a wide selection of sources for example Spotify. At the moment I know of no Discord bots capable of controlling an mpd/mopidy server so the adding of playlists have to go through a webinterface or similar. In this guide I will focus on setting up Spotify. The full config files will also be in the gist.

Mopidy

Installation