Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

@gosvig123
gosvig123 / LicensePlateProblem.js
Created October 19, 2025 12:06
License plate number generator with multiple schemas
/**
* You work for the DMV; you have a specific, sequential way of generating new license plate numbers:
*
* Each license plate number has 6 alphanumeric characters. The numbers always come before the letters.
*
* The first plate number is 000000, followed by 000001...
* When you arrive at 999999, the next entry would be 00000A, Followed by 00001A...
* When you arrive at 99999A, the next entry is 00000B, Followed by 00001B...
* After following the pattern to 99999Z, the next in the sequence would be 0000AA...
*
@gosvig123
gosvig123 / ConcurrencyExercise.js
Created October 18, 2025 16:19
Concurrent URL fetching with worker queue implementation
// Given an array of URLs and a MAX_CONCURRENCY integer, implement a
// function that will asynchronously fetch each URL, not requesting
// more than MAX_CONCURRENCY URLs at the same time. The URLs should be
// fetched as soon as possible. The function should return an array of
// responses for each URL.
// How would you write a test for such a function?
async function fetchUrlsFromQueue(urlQueue, fetchResults) {
while (urlQueue.length > 0) {
@gosvig123
gosvig123 / ConcurrencyExercise.js
Last active October 18, 2025 12:45
Concurrent URL fetching with worker queue implementation (using spread operator)
async function fetchUrlsFromQueue(urlQueue, fetchResults) {
while (urlQueue.length > 0) {
const currentUrl = urlQueue.shift();
try {
const fetchedResponse = await fetch(currentUrl);
fetchResults.successfulResponses.push(fetchedResponse);
} catch (error) {
fetchResults.failedUrls.push({
url: currentUrl,
@gosvig123
gosvig123 / .DS_Store
Last active October 4, 2025 16:33
Personal Tasks List
{"name":"clean","settings":"{\"settings\":\"{\\n \\\"files.autoSave\\\": \\\"afterDelay\\\",\\n \\\"git.blame.editorDecoration.enabled\\\": true,\\n \\\"javascript.inlayHints.functionLikeReturnTypes.enabled\\\": true,\\n \\\"search.quickOpen.includeSymbols\\\": true,\\n \\\"git.autofetch\\\": true,\\n \\\"git.confirmSync\\\": false,\\n \\n \\\"cSpell.userWords\\\": [\\n \\\"macd\\\",\\n \\\"supabase\\\",\\n \\\"vapi\\\"\\n ],\\n \\\"[python]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.black-formatter\\\"\\n },\\n \\\"diffEditor.experimental.useTrueInlineView\\\": true,\\n \\\"explorer.confirmDelete\\\": false,\\n \\\"editor.bracketPairColorization.independentColorPoolPerBracketType\\\": true,\\n \\\"debug.showVariableTypes\\\": true,\\n \\\"javascript.inlayHints.parameterTypes.enabled\\\": true,\\n \\\"javascript.inlayHints.variableTypes.enabled\\\": true,\\n \\\"typescript.inlayHints.enumMemberValues.enabled\\\": t
{"name":"nvim v1.0.3 2","settings":"{\"settings\":\"{\\n \\\"editor.tabCompletion\\\": \\\"off\\\",\\n \\\"[javascript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[javascriptreact]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[python]\\\": {\\n \\\"editor.tabSize\\\": 4,\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.black-formatter\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"gitlens.codeLens.enabled\\\": true\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSiz