Skip to content

Instantly share code, notes, and snippets.

View vanyle's full-sized avatar
💭

Antoine Delègue vanyle

💭
View GitHub Profile
@vanyle
vanyle / sound.js
Last active August 27, 2021 17:53
A JavaScript file to generate sounds procedurally on any browser by generating WAV files as data URI
// This function only generates pure frequencies but you can customize the waveform
// by changing the function at line ~50 (the one with the cos)
function sound(freq,volume,duration,fadeout){
// Generate a wav binary file, convert it to a blob and play it.
// https://fr.wikipedia.org/wiki/Waveform_Audio_File_Format#Structure_des_fichiers_WAV
const sampling = 44100; // in hertz
duration = duration || 1; // in seconds
const sampleCount = Math.floor(sampling * duration);
@vanyle
vanyle / tiny_node_server.js
Created August 20, 2021 19:55
A minimal example of a node server able to serve all files inside a directory. It uses no dependencies like express.
// 1. No dependencies.
// 2. Provide files in current directory and childrens
// 3. Tiny.
// Useful if you need to quickly setup a webserver for testing or prototyping.
const port = 80;
const http = require('http');
const fs = require('fs');
const path = require('path');
@vanyle
vanyle / modding_discord.md
Last active November 9, 2024 23:01
Modding the Discord client

Modding the discord client

Disclaimer: Modding the discord client is against Discord's term of service. I'm not responsible if any action is taken against you.

Why modding ?

Modding the client will allow you to customize to:

  • change the appearance of the discord client
  • have script to automaticaly send messages at specific times
  • log messages from a chat into a local file

This guide will explain how to inject js code into the discord client and send messages. I'm assuming you know you to write javascript code and are using Windows.