Skip to content

Instantly share code, notes, and snippets.

View jonahsnider's full-sized avatar
🌸
:trollface: github has a trollface emoji

Jonah Snider jonahsnider

🌸
:trollface: github has a trollface emoji
View GitHub Profile
@jonahsnider
jonahsnider / four.js
Last active June 19, 2023 23:59
Get the value 4 in Node.js
const four = () => process.toString().big().endsWith(String.fromCharCode(18 + ((process.toString().substring(1, 2).charCodeAt(Number.MIN_VALUE)) * 4) - Math.pow(20, 2))).toString().length;
console.log(four()); // 4
const assert = require("assert");
const fourButReadable = () => {
// String that contains an o as the second character
const objectInString = process.toString();
assert.strictEqual(objectInString, "[object process]");
@jonahsnider
jonahsnider / collapsible.md
Created November 14, 2019 02:02
Collapsible block in Markdown

Collapsible blocks in Markdown

<details>
  <summary>Click to show more</summary>
  Collapsible content
</details>
@jonahsnider
jonahsnider / nitro-gen.js
Created October 9, 2020 16:12
Discord Nitro key generator (2020) (real) (working) (real)
(Math.random('discord.com/nitro').toString(26).substring(2, 15) + Math.random('discord.com/nitro').toString(26).substring(2, 7)).split('').map((c, i) => (i + 1) % 4 === 0 ? c + '-' : c).join('').replace(/..$/, '').toUpperCase()

Keybase proof

I hereby claim:

  • I am jonahsnider on github.
  • I am jonahsnider (https://keybase.io/jonahsnider) on keybase.
  • I have a public key whose fingerprint is E3D7 8B8F 4596 CD63 5F30 4439 E85C E1D3 1913 2409

To claim this, I am signing this object:

@jonahsnider
jonahsnider / results.md
Last active January 9, 2022 23:18
Number validation with built-in JS
Input !Number.isNaN(x) !isNaN(x) typeof x === 'number' isFinite(x) Number.isFinite(x) Number.isInteger(x) Number.isSafeInteger(x)
123
"123"
NaN
"NaN"
@jonahsnider
jonahsnider / index.mjs
Created December 12, 2022 22:19
Find FRC teams attending events that take place before a given event
// @ts-check
// curl --request GET \
// --url 'https://frc-api.firstinspires.org/v3.0/2023/teams?eventCode=casf' \
// --header 'Authorization: Basic <token>}'
import rawSf from "./sf/raw.json" assert { type: "json" };
import * as fs from "fs/promises";
const teams = rawSf.teams.map((team) => team.teamNumber);