Skip to content

Instantly share code, notes, and snippets.

View ethndotsh's full-sized avatar
🎒
test

ethan ethndotsh

🎒
test
View GitHub Profile
@ethndotsh
ethndotsh / [username].js
Created February 19, 2022 01:18
Broken Noblox Next.js API Route
//pages/api/proxy/get-by-username/[username].js
import noblox from "noblox.js";
export default async function handler(req, res) {
const { username } = req.query;
const id = await noblox.getIdFromUsername(username);
const user = await noblox.getPlayerInfo(1);
@ethndotsh
ethndotsh / Dockerfile
Created July 12, 2022 22:25
Efficient Deno Dockerfile. Bundles it!
FROM denoland/deno:1.23.4
EXPOSE 3001
WORKDIR /app
COPY deps.ts .
RUN deno cache deps.ts
COPY . .
@ethndotsh
ethndotsh / StepWizard.jsx
Created January 8, 2023 01:55
react-step-wizard Replacement
import React, { useState, useEffect } from "react";
import styles from "./StepWizard.module.css";
export function StepWizard({
children = [],
className = null,
initialStep = 1,
isHashEnabled = false,
isLazyMount = false,
transitions = undefined,
@ethndotsh
ethndotsh / gradient.js
Created January 8, 2023 02:10
Generate a random gradient - using Vercel OG
import { ImageResponse } from "@vercel/og";
import random from "random-seed";
export const config = {
runtime: "edge",
};
function hslToHex(h, s, l) {
l /= 100;
const a = (s * Math.min(l, 1 - l)) / 100;