- Make available to use the webcam in the bottom of vscode
- Import on javascript project automatically runs
yarn addor another install command from a package manger - A tool to crop and resize images directly from the code editor
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
| function CreateShape(context){ | |
| this.context = context | |
| } | |
| CreateShape.prototype.Rect = function(width, height, x, y){ | |
| this.width = width | |
| this.height = height | |
| this.x = x | |
| this.y = y | |
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 content = { | |
| title: "<h1>This is a title</h1>", | |
| pretitle: "<h3>This is a pretitle</h3>", | |
| description: | |
| "<p>This is a <strong>description</strong> that's you will use</p>" | |
| } | |
| const tags = { | |
| p: ["<p>", "</p>"], | |
| h1: ["<h1>", "</h1>"], |
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
| function validSudoku(matrix){ | |
| const rows = [], cols = [], boxes = [] | |
| matrix.forEach((_) => { | |
| rows.push(new Set()) | |
| cols.push(new Set()) | |
| boxes.push(new Set()) | |
| }) | |
| for(let y = 0; y < matrix.length; y++){ |
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
| function csvColumns(csv, indices){ | |
| const split = csv.split('\n') | |
| const data = split.map((item) => item.split(',')) | |
| const accum = [] | |
| for(let y = 0; y < indices.length;y++){ | |
| if(data[y] === undefined) break | |
| accum.push(data[y].filter((e, i) => indices.indexOf(i) !== -1)) | |
| } |
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
| let stack = [] | |
| let math = null | |
| const start = (pushFn) => (pushFn => pushFn)(pushFn) | |
| const end = (() => { | |
| return math | |
| })() | |
| // const end = (function(){ |
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 TARGET_X = 1 | |
| const TARGET_Y = 0 | |
| function isSafe(maze, x, y, MAZE_SIZE){ | |
| return (x >= 0 && x < MAZE_SIZE && y >= 0 | |
| && y < MAZE_SIZE && maze[x][y] === 0) | |
| } | |
| function searchPaths(maze, x, y, solution, MAZE_SIZE){ | |
| if(x === MAZE_SIZE - 1 && y === MAZE_SIZE - 1 && maze[x][y] === 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
| let str = "ABC" | |
| function swap(str, a, b){ | |
| const charArray = str.split("") | |
| let temp = charArray[a] | |
| charArray[a] = charArray[b] | |
| charArray[b] = temp | |
| return charArray.join("") | |
| } |
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
| function mazeRunner(maze, directions) { | |
| let location = [] | |
| maze.forEach(function(curr, index) { | |
| if (curr.indexOf(2) !== -1) location.push(index, curr.indexOf(2)) | |
| }) | |
| for (let step in directions) { | |
| if (directions[step] === 'E') | |
| location[1] += 1 |
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
| // how much boxes has stacked in a row | |
| function boxesInRow(row){ | |
| let boxes = [] | |
| for(let y in row){ | |
| let count = 0 | |
| for(let x in row){ | |
| if(row[x] !== 0){ | |
| row[x] -= 1 | |
| count++ |