Skip to content

Instantly share code, notes, and snippets.

@dragonwocky
dragonwocky / notion-fonts.css
Created January 10, 2021 01:41
custom css for changing fonts on the notion.so website
View notion-fonts.css
:root {
--theme--font_sans: -apple-system, BlinkMacSystemFont, 'Segoe UI',
Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji',
'Segoe UI Symbol';
--theme--font_serif: Lyon-Text, Georgia, YuMincho, 'Yu Mincho',
'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'Songti TC', 'Songti SC',
SimSun, 'Nanum Myeongjo', NanumMyeongjo, Batang, serif;
--theme--font_mono: iawriter-mono, Nitti, Menlo, Courier, monospace;
--theme--font_code: SFMono-Regular, Consolas, 'Liberation Mono', Menlo,
Courier, monospace;
View ws-rooms-implementation.js
const wss = new ws.Server({ server: server });
_.broadcast = (data, room) => {
wss.clients.forEach(client => {
if (client.readyState === ws.OPEN) {
if (!room || client.room === room)
client.send(JSON.stringify(data), error => {
if (error) console.log(error);
});
}
View keybase.md

Keybase proof

I hereby claim:

  • I am dragonwocky on github.
  • I am thedragonring (https://keybase.io/thedragonring) on keybase.
  • I have a public key ASA5390A6vcAxxjk0UCKZhzsz1dsY6KiqMYl4AY5-QezQAo

To claim this, I am signing this object:

@dragonwocky
dragonwocky / discord-webhook.js
Last active January 14, 2024 14:49
js post request example for discord webhooks using the fetch web api
View discord-webhook.js
// node.js versions pre-v0.18.0 do not support the fetch api and require a polyfill
// const fetch = require('node-fetch');
fetch(
'https://discordapp.com/api/webhooks/738983040323289120/mzhXrZz0hqOuUaPUjB_RBTE8XJUFLe8fe9mgeJjQCaxjHX14c3SW3ZR199_CDEI-xT56',
{
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({