Skip to content

Instantly share code, notes, and snippets.

View nathanialhenniges's full-sized avatar
🏠
Working from home

Nathanial Henniges nathanialhenniges

🏠
Working from home
View GitHub Profile
@advaith1
advaith1 / discordjs-slash-commands.md
Last active December 1, 2025 19:23
Slash Commands in Discord.js
@stmoerman
stmoerman / redirect.md
Last active January 17, 2019 19:40
Apache2 htaccess redirect non-www to www with SSL/HTTPS

Without HSTS (single redirect):

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

With HSTS (double redirect):

@siwalikm
siwalikm / aes-256-cbc.js
Last active August 11, 2025 11:49
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {