Skip to content

Instantly share code, notes, and snippets.

View jessejputnam's full-sized avatar

Jesse Putnam jessejputnam

View GitHub Profile
@jessejputnam
jessejputnam / Burger.tsx
Last active June 4, 2023 11:49
Animated React burger menu using Styled Components. Burger buns move to center, then flair out into an 'X', and reverse. Requires that Burger receives boolean prop of "open", regarding whether the presumably connected menu is open or closed.
import styled from "styled-components";
const mobile = "601px";
const boxSize = "60px";
const delay = "0.2s";
const barSize = "5px";
const barColor = "black";
const Box = styled.div`
position: relative;
import java.util.ArrayList;
class Solution {
public List<String> letterCombinations(String digits) {
ArrayList<String> output = new ArrayList<>();
String[] arr = getLettersArr(digits);
if (digits.isEmpty()) return output;
recur(arr, "", output);
@jessejputnam
jessejputnam / reset.css
Created December 21, 2022 11:45
Very simple full CSS reset
/* Simplest CSS Reset */
*, *::before, *::after {
box-sizing: border-box
}
* {
margin: 0;
padding: 0;
font: inherit;
@jessejputnam
jessejputnam / dnd-tavern-marketing-budget.js
Last active January 8, 2023 12:08
Snippet that simulates DnD 5e tavern marketing budget scenarios to determine optimal marketing budget from players
/**
* DnD 5e Waterdeep campaign includes a Tavern controlled by players, that for
* every 10-day cycle, must have upkeep given but also can earn income from
* the business. That net income is determined by dice roll. However, players
* may opt to add a --marketing budget-- which adds on to the dice roll...
* but at what (literal) cost?
*
* To answer the question of which amount of gold would grant best return on
* investment, I wrote this to run scenarios to determine, over many iterations,
* what the best choice of marketing budget would be.
@jessejputnam
jessejputnam / array_methods_cheats.md
Created August 16, 2022 12:57
A cheatsheet for choosing JavaScript array methods

Choosing an array method

I want to...

Mutate the original array

  • Add to original:
arr.push
arr.unshift