Skip to content

Instantly share code, notes, and snippets.

View claudianus's full-sized avatar
๐Ÿ 
Working from home

Claudianus Mamertus claudianus

๐Ÿ 
Working from home
  • Modumaru
  • South Korea
  • 15:44 (UTC +09:00)
View GitHub Profile
@joepie91
joepie91 / random.md
Last active April 11, 2025 09:42
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@jagrosh
jagrosh / Growing A Discord Server.md
Last active June 12, 2025 06:16
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@hakasenyang
hakasenyang / SSLTLS.md
Last active May 26, 2019 07:48
์•ˆ์ „ํ•œ SSL/TLS ๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

์•ˆ์ „ํ•œ SSL/TLS ๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

SSL/TLS ์ธ์ฆ์„œ ํฌ๊ธฐ

ํ˜„์žฌ SSL ํฌ๊ธฐ ์ค‘์— ์•ˆ์ „ํ•˜๋ฉด์„œ๋„ ๊ฐ€๋ฒผ์šด (์†๋„ ๋น ๋ฅธ) ํฌ๊ธฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • ECC : 256 bit
  • RSA : 2048 bit

์ด ํฌ๊ธฐ๋ณด๋‹ค ๋” ํฐ ๊ฒฝ์šฐ์—๋Š” ์†๋„๊ฐ€ ๋А๋ฆฌ๋‹ค๋Š” ๋‹จ์ ์ด ์žˆ๋‹ค. ๋ฌผ๋ก  PC์—์„œ๋Š” ์ฒด๊ฐํ•˜๊ธฐ ํž˜๋“ค๊ฒ ์ง€๋งŒ, ์„œ๋ฒ„์—๋„ ๋ถ€๋‹ด ๋  ๋ฟ๋”๋Ÿฌ ๋ชจ๋ฐ”์ผ ์‚ฌ์šฉ์ž์—๊ฒŒ๋Š” ์ข‹์€ ๊ฒฝํ—˜์ด ๋˜์ง€ ๋ชป ํ•œ๋‹ค.

@srestraj
srestraj / nuxt-3-gsi.md
Last active September 14, 2024 10:22
Integrate Google Sign-in with Nuxt 3.

Integrate Google Sign-in (Popup method) with Nuxt.js 3 - Works in Incognito mode as well

Add GSI client in your nuxt.config.ts
export default defineNuxtConfig({
  ...
  app: {
    head: {