Skip to content

Instantly share code, notes, and snippets.

View Shimilbi's full-sized avatar
💭
I may be slow to respond.

Shimilbi, tiny freelancer Shimilbi

💭
I may be slow to respond.
View GitHub Profile
@Shimilbi
Shimilbi / discord-webhook.js
Created January 14, 2024 14:48 — forked from dragonwocky/discord-webhook.js
js post request example for discord webhooks using the fetch web api
// 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({
@Shimilbi
Shimilbi / .htaccess
Created May 20, 2023 18:10 — forked from briatte/.htaccess
Show RSS feeds on a Web page via pure JavaScript, incl. code to bypass Chrome's CORS policy.
# enable CORS policy
# https://gist.github.com/maxparm/3105526
<IfModule mod_rewrite.c>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Header add Access-Control-Allow-Headers: "Content-Type"
RewriteEngine on
RewriteBase /
</IfModule>