Skip to content

Instantly share code, notes, and snippets.

View ACatThatPrograms's full-sized avatar

ACatThatPrograms ACatThatPrograms

View GitHub Profile
@ACatThatPrograms
ACatThatPrograms / setup-ssl.md
Created January 7, 2024 21:55 — forked from pedrouid/setup-ssl.md
Setup SSL with NGINX reverse proxy

Get a Free SSL Certificate With Let’s Encrypt

Let’s Encrypt is a free, automated, and open Certificate Authority.

  1. Install tools for using the Let's Encrypt certificates using Certbot
  sudo apt-get update \
  sudo apt-get install software-properties-common
@ACatThatPrograms
ACatThatPrograms / uuidv4.js
Last active February 2, 2022 21:08
Generate RFC 4122 compliant UUIDv4
/**
* Generate an RFC 4122 compliant v4uuid using window.crypto.getRandomValues
* @returns {String} - A newly generated v4uuid
*/
export function genUuidv4() {
let hex = window.crypto.getRandomValues(new Uint8Array(128 / 8)); // Or your crypto lib of choice -- Slice off the 0x if lib provides it.
let bytes = Buffer.from(hex, 'hex');
// Force byte 7 and 9 to unsigned and pad to 8 bits
let byte7asBin = (bytes[6] >>> 0).toString(2).padStart(8, "0"); // Get byte 7 as binary
@ACatThatPrograms
ACatThatPrograms / check_trail_cache
Last active March 7, 2019 16:15
Written in GDScript :: First function tracks movement direction as a vector and entity facing direction of follower entities that trail behind the player for classic JRPG like caching of last-player-positions within an array for utilizing within the follower entities for movement : The second function is using this array and providing a unique e…
func check_trail_cache():
if player_last_pos != player.position:
position = player_trail[0][0]
move_dir = player_trail[0][1]
if position_index < frame_offset:
position_index += 1
else:
position_index = 0
### Keybase proof
I hereby claim:
* I am acatthatprograms on github.
* I am acatthatprograms (https://keybase.io/acatthatprograms) on keybase.
* I have a public key ASAfFvOikGHt7gqXDN4VRburi_t5e-hycyKyeSYirro5_Qo
To claim this, I am signing this object: