This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Opinionated Algorithm Prompt (Strict Format, No Questions) | |
| For every algorithm problem I give you, follow this exact structure without asking anything or modifying the order. | |
| ### 1. Plain English Restatement | |
| Describe the problem in the simplest terms so a nontechnical person could understand it. Explain what's the input and expected output | |
| ### 2. Why Naive Approaches Fail | |
| Show the brute force idea/solutions and explain why it is inefficient or incorrect. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 🔄 1. **Native in Browsers — No Bundling Required** | |
| - ESM is **natively supported by modern browsers**, so Vite can skip bundling in development. | |
| - That means: | |
| - You change a file → Vite transpiles just that file → browser loads it as a module. | |
| - No need to wait for a full (or partial) rebuild like with Webpack. | |
| --- | |
| ### 🎯 2. **On-Demand Loading** | |
| - Modules are **loaded only when they're needed**. |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = reqiure("fs"); | |
| (async () => { | |
| let files = []; | |
| let lineCount = 0; | |
| const directoryPath = "."; | |
| const fileType = "csv"; | |
| try { | |
| const fileNames = fs.readdirSync(directoryPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from "fs"; | |
| (async () => { | |
| let files = []; | |
| let lineCount = 0; | |
| const directoryPath = "."; | |
| const fileType = "csv"; | |
| try { | |
| const fileNames = fs.readdirSync(directoryPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # ___ __ __ ____ _ ____ _ | |
| # / _ \| \/ |/ ___( )___ / ___| ___| |_ _ _ _ __ | |
| # | | | | |\/| | | |// __| \___ \ / _ \ __| | | | '_ \ | |
| # | |_| | | | | |___ \__ \ ___) | __/ |_| |_| | |_) | | |
| # \___/|_| |_|\____| |___/ |____/ \___|\__|\__,_| .__/ | |
| # |_| | |
| echo "Creating an SSH key for you..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func binarySearch<T: Comparable> (on array: [T], target: T) -> Int?{ | |
| if(array.count <= 1 && array.first != target){ | |
| return nil | |
| } | |
| let middle = array.count/2 | |
| if(target == array[middle]){ | |
| return middle | |
| }else if(target < array[middle]){ | |
| return binarySearch(on: Array(array.dropLast(middle)), target: target) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |