Skip to content

Instantly share code, notes, and snippets.

View Frastio10's full-sized avatar
:octocat:
dead

Frastio Agustian Frastio10

:octocat:
dead
View GitHub Profile
@mousebyte
mousebyte / coc-discord-rpc-wsl-passthrough.md
Last active March 4, 2024 08:34
coc-discord-rpc on WSL: passthrough to Discord on host Windows

Using coc-discord-rpc on WSL

You can use [npiperelay][] to let coc-discord-rpc connect to a Discord instance running on the host Windows operating system. It requires modifying the extension a bit, but it's relatively painless. This guide assumes you have [coc.nvim][] and [coc-discord-rpc][] already installed.

Get npiperelay and socat

To build npiperelay, you'll need [Go][]. Grab the golang package from your favorite package manager and follow the instructions on the [npiperelay][] repo. You'll also need to install socat if it doesn't come with your distribution.

@Frastio10
Frastio10 / socket.js
Last active July 29, 2023 12:31
NodeJS basic tcp socket client and server without external library
// nodejs provided this example already on https://nodejs.org/api/http.html#http_event_upgrade
// I changed some stuffs so I can understand it better.
const http = require('http');
// Create an HTTP server
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('okay');
});