- ✅ useTimeMachine
- undo
- redo
- current
- history mode
-✅ Something with Dall-E API (OpenAi Image Gen) must be done with Nest.js and Next.js
| function checkCol(board){ | |
| for(let y = 0; y < board.length; y++){ | |
| let countX = 0, countO = 0 | |
| for(let x = 0; x < board[y].length; x++){ | |
| const cell = board[x][y] | |
| if(cell === 1) countX++ | |
| else if(cell === 2) countO++ | |
| } | |
| if(countX === 3) return 1 | |
| if(countO === 3) return 2 |
| const image = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] | |
| function rotateImage(img){ | |
| for(let y = 0; y < img.length; y++) | |
| { | |
| for(let x = y; x < img[0].length; x++) | |
| { | |
| [img[y][x], img[x][y]] = [img[x][y], img[y][x]] | |
| } | |
| const str = "allowPathCascade" | |
| const regx = /([A-Z][^A-Z]*)/g | |
| console.log(`original string: ${str}`) | |
| function camelCase(str) { | |
| return str | |
| .replace(/\s(.)/g, function($1) { return $1.toUpperCase(); }) | |
| .replace(/\s/g, '') |
| const hashBase = "da39a3ee5e6b4b0d3255bfef95601890afd80709c2" | |
| const hashReduce = hashBase.split('').reduce((ac, cur, index, array) => { | |
| ac.push(cur) | |
| if(index % 6 === 5){ | |
| ac.push('-') | |
| } | |
| function number(seats){ | |
| if(seats[0] <= 0) return 0 | |
| const calculate = seats.reduce((result, current) => { | |
| result += current[0] | |
| result -= current[1] | |
| return result |
| function findDuplicateIntegers(nums){ | |
| const accumulator = [] | |
| for(let i = 0; i < nums.length; i++){ | |
| if(nums[i] in accumulator){ | |
| return true | |
| } | |
| accumulator[nums[i]] = i | |
| } |
| const fs = require("fs"); | |
| const START_WORD = "@step("; | |
| const PATH_TO_FILE = "./data/example.py"; | |
| const FILE_NAME = "./data/letters.txt"; | |
| function readFile(path) { | |
| const data = fs.readFileSync(path, { encoding: "utf8", flag: "r" }); | |
| return data; | |
| } |
| local listOfSteps = {} | |
| local newFileData = {} | |
| local defaultMatchPattern = "('.*')" | |
| local path = 'data/step_python_test.txt' | |
| local target = '@step' | |
| function file_exists(file) | |
| local f = io.open(file, "rb") | |
| if f then f:close() end | |
| return f ~= nil |