Skip to content

Instantly share code, notes, and snippets.

@scottmries
scottmries / gist:4cfb71ed29746f089e5b4fb988a103f7
Created November 16, 2023 23:14
brackets problem recursive solution with string size reduction
const tests = [
'()[]{}',
'(((]))',
'((()))',
'](',
'(()',
'())'
]
const solutions = [
'()[]{}'
'(((]))'
']('
processClosedBracket('()[]{}')
processOpenBracket('paren', ')[]{}')
const isOpening = (char) => {
@scottmries
scottmries / gist:0960608c7b8070d53f0b593f5b0bce72
Last active October 24, 2023 18:17
Portfolio site Dockerfile
# syntax = docker/dockerfile:1
FROM node:alpine as base
LABEL fly_launch_runtime="Next.js"
# Next.js app lives here
WORKDIR /app
# Set production environment
@scottmries
scottmries / schedule.py
Created October 9, 2023 14:49
n-team, exactly-one-matchup league generator
import sys
teams = int(input("Input the number of teams")) if len(sys.argv) <= 1 else int(sys.argv[1])
weeks = []
for i in range(teams - 1):
week = []
remaining_teams = [*range(teams)]
# Always 0
fixed_point = remaining_teams.pop(0)
# coding=utf-8
from sys import argv
import random, time
def bold(s):
return '\033[1m'+s+'\033[0m'
def italic(s):
return " ** "+bold(s)