Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonah Snider pizzafox

View GitHub Profile
@pizzafox
pizzafox / nitro-gen.js
Created Oct 9, 2020
Discord Nitro key generator (2020) (real) (working) (real)
View nitro-gen.js
(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()
@pizzafox
pizzafox / diff.txt
Created Feb 7, 2020
Next.js SSR performance testing
View diff.txt
Server Software:
Server Hostname: localhost
Server Port: 3000
Document Path: /VARIABLE
Document Length: 1735 bytes
Concurrency Level: 20
Time taken for tests: 9.178 seconds
Complete requests: 9000
@pizzafox
pizzafox / http-request-methods.ts
Created Dec 27, 2019
A TypeScript Enum of HTTP request methods.
View http-request-methods.ts
/**
* Set of HTTP request methods to indicate the desired action to be performed for a given resource.
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
*/
export enum HTTPRequestMethods {
/** The `GET` method requests a representation of the specified resource. Requests using `GET` should only retrieve data. */
GET = 'GET',
/** The `HEAD` method asks for a response identical to that of a `GET` request, but without the response body. */
HEAD = 'HEAD',
/** The `POST` method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. */
@pizzafox
pizzafox / collapsible.md
Created Nov 14, 2019
Collapsible block in Markdown
View collapsible.md

Collapsible blocks in Markdown

<details>
  <summary>Click to show more</summary>
  Collapsible content
</details>
@pizzafox
pizzafox / four.js
Last active Oct 19, 2020
Get the value 4 in Node.js
View four.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]");
View discord.log
[2/13/2019] [2:57:26 AM] [shard 0] [discord.js] › ⬤ debug Authenticating using token ###########################################################
[2/13/2019] [2:57:26 AM] [shard manager] › ✔ success Clusters spawned
[2/13/2019] [2:57:26 AM] [shard manager] › ⬤ debug [IPC] Client Connected: Cluster 0
[2/13/2019] [2:57:26 AM] [shard 0] [discord.js] › ⬤ debug Using gateway wss://gateway.discord.gg/
[2/13/2019] [2:57:26 AM] [shard 0] [discord.js] › ⬤ debug Spawning 4 shards
[2/13/2019] [2:57:26 AM] [shard 0] [discord.js] › ⬤ debug [Shard 0] Connecting to wss://gateway.discord.gg/
[2/13/2019] [2:57:27 AM] [shard 0] [discord.js] › ⬤ debug [Shard 0] Connected to the gateway
[2/13/2019] [2:57:27 AM] [shard 0] [discord.js] › ⬤ debug [Shard 0] Setting a heartbeat interval for 41250ms
[2/13/2019] [2:57:27 AM] [shard 0] [discord.js] ›
@pizzafox
pizzafox / say.js
Last active Feb 12, 2019
Say command made for the Commando Discord bot framework.
View say.js
const { Command } = require('discord.js-commando');
class SayCommand extends Command {
constructor(client) {
super(client, {
name: 'say',
memberName: 'say',
group: 'test',
aliases: ['echo', 'repeat'],
description: 'A command that repeats whatever you say.',
View MAKING THE ONLY DISCORD BOT YOU'LL EVER NEED TO BE POPULAR AND SUCCEED IN A HIGHER SOCIETY AND BE THE COOLEST AND HIRE-ABLE PERSON IN THE TECH INDUSTRY.md
@pizzafox
pizzafox / brightnessDetection.js
Created Jan 23, 2018
Pseudocode for ping-pong
View brightnessDetection.js
if (leftBrightness < rightBrightness && middleBrightness > leftBrightness) {
// Ball is on the left and not the middle
moveLeft();
} else if (rightBrightness < leftBrightness && middleBrightness > rightBrightness) {
// Ball is on the left and not the middle
moveRight();
} else if (middleBrightness < leftBrightness && middleBrightness < rightBrightness) {
// Ball is in the middle
// Wait for it to continue moving and then chase after it.
} else {
View keybase.md

Keybase proof

I hereby claim:

  • I am pizzafox on github.
  • I am pizzafox (https://keybase.io/pizzafox) on keybase.
  • I have a public key ASB42EeLq8P79iR4evxq4GwYDov7-ppaOy5Wp76sewML-Ao

To claim this, I am signing this object:

You can’t perform that action at this time.