{"id":22919978,"url":"https://github.com/xgqfrms/vscode","last_synced_at":"2025-05-12T20:20:20.354Z","repository":{"id":37663150,"uuid":"68596523","full_name":"xgqfrms/vscode","owner":"xgqfrms","description":":cn: :rocket: Visual Studio Code  \u0026 VSCode Code Snippets All in One 🎉","archived":false,"fork":false,"pushed_at":"2024-06-29T17:08:00.000Z","size":5671,"stargazers_count":3,"open_issues_count":66,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T20:20:09.341Z","etag":null,"topics":["code-snippets","dart","go","html5","javascript","leetcode","php","python","react","sql","swift","typescript","vscode","vue","webassembly","xgqfrms"],"latest_commit_sha":null,"homepage":"https://vscode.xgqfrms.xyz","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xgqfrms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-19T10:46:20.000Z","updated_at":"2024-06-29T17:08:03.000Z","dependencies_parsed_at":"2024-06-29T18:25:36.767Z","dependency_job_id":"f2271d57-54f3-4621-b952-f26476375658","html_url":"https://github.com/xgqfrms/vscode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fvscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fvscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fvscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fvscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xgqfrms","download_url":"https://codeload.github.com/xgqfrms/vscode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253815079,"owners_count":21968566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-snippets","dart","go","html5","javascript","leetcode","php","python","react","sql","swift","typescript","vscode","vue","webassembly","xgqfrms"],"created_at":"2024-12-14T07:14:01.743Z","updated_at":"2025-05-12T20:20:20.280Z","avatar_url":"https://github.com/xgqfrms.png","language":null,"readme":"# VSCode All In One\n\n[https://vscode.xgqfrms.xyz/](https://vscode.xgqfrms.xyz/)\n\n[https://github.com/xgqfrms/vscode](https://github.com/xgqfrms/vscode)\n\n## VSCode (shortcuts)\n\nShift + Alt + A === Block Commnets\n\nCtrl + / === line Commnets\n\n## VSCode Code Snippets\n\n\u003e tst with dynamic testcases for leetcode\n\n```json\n{\n  \"TypeScript Template\": {\n    \"prefix\": \"tst\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2023-02-1$1\",\n      \" * @modified \",\n      \" * \",\n      \" * @description \",\n      \" * @description \",\n      \" * @difficulty Easy\",\n      \" * @difficulty Medium\",\n      \" * @difficulty Hard\",\n      \" * @ime_complexity O(n)\",\n      \" * @space_complexity O(n)\",\n      \" * @augments \",\n      \" * @example \",\n      \" * @link https://leetcode.com/problems/$2/\",\n      \" * @link https://leetcode.cn/problems/$2/\",\n      \" * @solutions \",\n      \" * \",\n      \" * @best_solutions \",\n      \" * \",\n      \" */\",\n      \"\",\n      \"export {};\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"// \",\n      \"\",\n      \"\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"class TreeNode {\",\n      \"  val: number;\",\n      \"  left: TreeNode | null;\",\n      \"  right: TreeNode | null;\",\n      \"  constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) {\",\n      \"    this.val = (val === undefined ? 0 : val);\",\n      \"    this.left = (left === undefined ? null : left);\",\n      \"    this.right = (right === undefined ? null : right);\",\n      \"  }\",\n      \"}\",\n      \"\",\n      \"// LeetCode tree test case\",\n      \"// 二叉树生成原理：递归依次遍历（左=\u003e右），遇到 null 返回 (✅ null 后面不能有子节点了)\",\n      \"const BinaryTreeGenerator = (arr:number[] = [], i = 0): (TreeNode | null) =\u003e {\",\n      \"  if(arr.length === 0 || i \u003e arr.length - 1 || arr[i] === null) {\",\n      \"    return null;\",\n      \"  }\",\n      \"  const node = new TreeNode(arr[i]);\",\n      \"  // 先左后右， 依次遍历\",\n      \"  node.left = BinaryTreeGenerator(arr, 2 * i + 1);\",\n      \"  node.right = BinaryTreeGenerator(arr, 2 * i + 2);\",\n      \"  return node;\",\n      \"}\",\n      \"*/\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"// 测试用例 test cases\",\n      \"const testCases = [\",\n      \"  {\",\n      \"    inputs: [],\",\n      \"    input: '4193 with words  ',\",\n      \"    result: 4193,\",\n      \"    desc: 'value equal to 4193',\",\n      \"  },\",\n      \"];\",\n      \"\",\n      \"for (const [i, testCase] of testCases.entries()) {\",\n      \"  const tree = BinaryTreeGenerator(testCase.input);\",\n      \"  const result = invertTree(tree);\",\n      \"  const treeResult = BinaryTreeGenerator(testCase.result);\",\n      \"  log(`test case \\\\${i} result: `, JSON.stringify(result) === JSON.stringify(treeResult) ? `✅ passed` : `❌ failed`, testCase.result);\",\n      \"\",\n      \"  const [first, second] = testCase.inputs;\",\n      \"  const result = $4(first, second);\",\n      \"  log(`test case \\\\${i} result: `, JSON.stringify(result) === JSON.stringify(testCase.result) ? `✅ passed` : `❌ failed`, result);\",\n      \"  const result = $4(testCase.input);\",\n      \"  log(`test case \\\\${i} result: `, result === testCase.result ? `✅ passed` : `❌ failed`, result);\",\n      \"  // log(`test case ${i} =`, testCase);\",\n      \"}\",\n      \"\",\n      \"*/\",\n      \"\",\n      \"\",\n      \"// $ npx ts-node ./$3\\\\ $2.ts\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"\",\n      \"\",\n      \"*/\",\n      \"\"\n    ],\n    \"description\": \"TypeScript Template \u0026 code snippets!\"\n  }\n}\n\n\n```\n\n\u003e js6r with dynamic test cases\n\n```json\n{\n  \"JavaScript ES6 React Template\": {\n    \"prefix\": \"js6r\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2022-03-0$1\",\n      \" * @modified \",\n      \" * \",\n      \" * @description \",\n      \" * @description \",\n      \" * @difficulty Easy Medium Hard\",\n      \" * @complexity O(n)\",\n      \" * @time O(n)\",\n      \" * @augments \",\n      \" * @example \",\n      \" * @link https://leetcode.com/problems/$2/\",\n      \" * @link https://leetcode-cn.com/problems/$2/\",\n      \" * @solutions \",\n      \" * \",\n      \" * @best_solutions \",\n      \" * \",\n      \" */\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"// Generator\",\n      \"const $3 = ($5datas = [], debug = false) =\u003e {\",\n      \"  let result = ``;\",\n      \"  // do something...\",\n      \"  return $7result;\",\n      \"};\",\n      \"\",\n      \"\",\n      \"export default $3;\",\n      \"export {\",\n      \"  $3,\",\n      \"};\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"\",\n      \"// 测试用例 test cases\",\n      \"const testCases = [\",\n      \"  {\",\n      \"    input: '4193 with words  ',\",\n      \"    result: 4193,\",\n      \"    desc: 'value equal to 4193',\",\n      \"  },\",\n      \"];\",\n      \"for (const [i, testCase] of testCases.entries()) {\",\n      \"  const result = $3(testCase.input);\",\n      \"  log(`test case ${i} result: `, result === testCase.result ? `✅ passed` : `❌ failed`, result);\",\n      \"  // log(`test case ${i} result:\\n\\t\\t`, result === testCase.result ? `passed ✅` : `failed ❌`, result);\",\n      \"  // log(`test case ${i} =`, testCase);\",\n      \"}\",\n      \"\",\n      \"\",\n      \"*/\",\n      \"\",\n    ],\n    \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n  }\n}\n```\n\n\u003e js6r (with test cases)\n\n```json\n{\n  \"JavaScript ES6 React Template\": {\n    \"prefix\": \"js6r\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2022-03-0$1\",\n      \" * @modified \",\n      \" * \",\n      \" * @description $2\",\n      \" * @description $2\",\n      \" * @difficulty Easy Medium Hard\",\n      \" * @complexity O(n)\",\n      \" * @time O(n)\",\n      \" * @augments \",\n      \" * @example \",\n      \" * @link https://leetcode.com/problems/???/\",\n      \" * @link https://leetcode-cn.com/problems/???/\",\n      \" * @solutions \",\n      \" * \",\n      \" * @best_solutions \",\n      \" * \",\n      \" */\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"// Generator\",\n      \"const $3 = ($5datas = [], debug = false) =\u003e {\",\n      \"  let result = ``;\",\n      \"  // do something...\",\n      \"  return $7result;\",\n      \"};\",\n      \"\",\n      \"\",\n      \"export default $3;\",\n      \"export {\",\n      \"  $3,\",\n      \"};\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"\",\n      \"// 测试用例\",\n      \"// test cases\",\n      \"const tests  = [\",\n      \"  '4193 with words  ',\",\n      \"  '   -42',\",\n      \"  '12345657890 bigint',\",\n      \"];\",\n      \"for (const [i, test] of tests.entries()) {\",\n      \"  const result = $3(test);\",\n      \"  if(typeof result === 'boolean') {\",\n      \"    log(`test${i} =`, result ? `✅` : `❌`);\",\n      \"  } else {\",\n      \"    log(`test${i} =`, result);\",\n      \"  }\",\n      \"}\",\n      \"\",\n      \"\",\n      \"*/\",\n      \"\",\n    ],\n    \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n  }\n}\n\n```\n\n\u003e test\n\n```json\n{\n  \"JavaScript ES6 React Template\": {\n    \"prefix\": \"js6r\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2022-03-0$1\",\n      \" * @modified \",\n      \" * \",\n      \" * @description $2\",\n      \" * @description $2\",\n      \" * @difficulty Easy Medium Hard\",\n      \" * @complexity O(n)\",\n      \" * @time O(n)\",\n      \" * @augments \",\n      \" * @example \",\n      \" * @link https://leetcode.com/problems/???/\",\n      \" * @link https://leetcode-cn.com/problems/???/\",\n      \" * @solutions \",\n      \" * \",\n      \" * @best_solutions \",\n      \" * \",\n      \" */\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"// Generator\",\n      \"const $3 = ($5datas = [], debug = false) =\u003e {\",\n      \"  let result = ``;\",\n      \"  // do something...\",\n      \"  return $7result;\",\n      \"};\",\n      \"\",\n      \"\",\n      \"export default $3;\",\n      \"export {\",\n      \"  $3,\",\n      \"};\",\n      \"\",\n      \"/*\",\n      \"\",\n      \"// error\",\n      \"const test1 = isValid(`((}}`);\",\n      \"// ok\",\n      \"const test2 = isValid(`()[]{}`);\",\n      \"\",\n      \"log(`❌test =`, test1 ? `✅` : `❌`);\",\n      \"log(`✅test ok =`, test2 ? `✅` : `❌`);\",\n      \"\",\n      \"// test cases\",\n      \"// 测试用例\",\n      \"const tests  = [\",\n      \"  '4193 with words  ',\",\n      \"  '   -42',\",\n      \"  '12345657890 bigint',\",\n      \"];\",\n      \"for (const [i, test] of tests.entries()) {\",\n      \"  const result = $3(test);\",\n      \"  log(`test${i} =`, result, result ? `✅` : `❌`);\",\n      \"}\",\n      \"\",\n      \"\",\n      \"*/\",\n      \"\",\n    ],\n    \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n  }\n}\n```\n\n\u003e js6r\n\n```json\n{\n    \"JavaScript ES6 React Template\": {\n        \"prefix\": \"js6r\",\n        \"body\": [\n            \"\\\"use strict\\\";\",\n            \"\",\n            \"/**\",\n            \" * \",\n            \" * @author xgqfrms\",\n            \" * @license MIT\",\n            \" * @copyright xgqfrms\",\n            \" * @created 2019-08-$1\",\n            \" * \",\n            \" * @description $2\",\n            \" * @augments $3\",\n            \" * @example $4\",\n            \" * @link $5\",\n            \" * \",\n            \" */\",\n            \"\",\n            \"const log = console.log;\",\n            \"\",\n            \"const $2Generator = ($5datas = [], debug = false) =\u003e {\",\n            \"    let result = ``;\",\n            \"    // do something...\",\n            \"    return $7result;\",\n            \"};\",\n            \"\",\n            \"\",\n            \"\",\n            \"export default $2;\",\n            \"\",\n            \"export {\",\n            \"    $2,\",\n            \"};\",\n            \"\",\n        ],\n        \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n    }\n}\n\n```\n\n\u003e js6r\n\n```json\n{\n  \"JavaScript ES6 React Template\": {\n    \"prefix\": \"js6r\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2020-01-0$1\",\n      \" * \",\n      \" * @description $2\",\n      \" * @augments $3\",\n      \" * @example $4\",\n      \" * @link $5\",\n      \" * \",\n      \" */\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"const $2Generator = ($5datas = [], debug = false) =\u003e {\",\n      \"    let result = ``;\",\n      \"    // do something...\",\n      \"    return $7result;\",\n      \"};\",\n      \"\",\n      \"\",\n      \"\",\n      \"export default $2;\",\n      \"\",\n      \"export {\",\n      \"    $2,\",\n      \"};\",\n      \"\"\n    ],\n    \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n  }\n}\n\n\n```\n\n\u003e ts6r\n\n```json\n\n{\n    \"TypeScript ES6 React Template\": {\n        \"prefix\": \"ts6r\",\n        \"body\": [\n            \"\\\"use strict\\\";\",\n            \"\",\n            \"/**\",\n            \" * \",\n            \" * @author xgqfrms\",\n            \" * @license MIT\",\n            \" * @copyright xgqfrms\",\n            \" * @created 2019.0$1.0$2\",\n            \" * \",\n            \" * @description $3\",\n            \" * @augments \",\n            \" * @example \",\n            \" * @link $4\",\n            \" * \",\n            \" */\",\n            \"\",\n            \"const $3Generator = ($5datas = [], debug = false) =\u003e {\",\n            \"    let result = ``;\",\n            \"    // do something...\",\n            \"    return $6result;\",\n            \"};\",\n            \"\",\n            \"\",\n            \"\",\n            \"export default $3;\",\n            \"\",\n            \"export {\",\n            \"    $3,\",\n            \"};\",\n            \"\"\n        ],\n        \"description\": \"TypeScript ES6 React Template \u0026 code snippets!\"\n    }\n}\n\n\n```\n\n\u003e p3y\n\n```json\n{\n  \"Python3 Template\": {\n    \"prefix\": \"py3\",\n    \"body\": [\n      \"# coding: utf8\",\n      \"\",\n      \"__author__ = 'xgqfrms'\",\n      \"\",\n      \"\\\"\\\"\\\"\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2020-01-0$1\",\n      \" * \",\n      \" * @description $2\",\n      \" * @augments $3\",\n      \" * @example $4\",\n      \" * @link $5\",\n      \" * \",\n      \" */\",\n      \"\",\n      \"\\\"\\\"\\\"\"\n    ],\n    \"description\": \"Python3 Template \u0026 code snippets!\"\n  }\n}\n\n```\n\n\u003e js6r （new version）\n\n```json\n\n{\n  \"JavaScript ES6 React Template\": {\n    \"prefix\": \"js6r\",\n    \"body\": [\n      \"\\\"use strict\\\";\",\n      \"\",\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2020-08-0$1\",\n      \" * @modified \",\n      \" * \",\n      \" * @description $2\",\n      \" * @difficulty Easy Medium Hard\",\n      \" * @complexity O(n)\",\n      \" * @augments \",\n      \" * @example \",\n      \" * @link \",\n      \" * @solutions \",\n      \" * \",\n      \" */\",\n      \"\",\n      \"const log = console.log;\",\n      \"\",\n      \"// Generator\",\n      \"const $3 = ($5datas = [], debug = false) =\u003e {\",\n      \"  let result = ``;\",\n      \"  // do something...\",\n      \"  return $7result;\",\n      \"};\",\n      \"\",\n      \"\",\n      \"\",\n      \"export default $3;\",\n      \"\",\n      \"export {\",\n      \"  $3,\",\n      \"};\",\n      \"\",\n    ],\n    \"description\": \"JavaScript ES6 React Template \u0026 code snippets!\"\n  }\n}\n```\n\n\u003e got\n\n```json\n{\n  \"Go Template\": {\n    \"prefix\": \"got\",\n    \"body\": [\n      \"/**\",\n      \" * \",\n      \" * @author xgqfrms\",\n      \" * @license MIT\",\n      \" * @copyright xgqfrms\",\n      \" * @created 2020-01-0$1\",\n      \" * \",\n      \" * @description $2\",\n      \" * @augments $3\",\n      \" * @example $4\",\n      \" * @link $5\",\n      \" * \",\n      \" */\",\n      \"\",\n      \"package main\",\n      \"\",\n      \"// import \\\"fmt\\\"\",\n      \"// import (\\\"fmt\\\")\",\n      \"import (\",\n      \"  \\\"fmt\\\"\",\n      \"  \\\"strings\\\"\",\n      \"  \\\"time\\\"\",\n      \"  \\\"math/rand\\\"\",\n      \"  \\\"testing\\\"\",\n      \"  \\\"bytes\\\"\",\n      \"  \\\"encoding/base64\\\"\",\n      \"  \\\"image\\\"\",\n      \"  \\\"image/png\\\"\",\n      \")\",\n      \"\",\n      \"func main() {\",\n      \"  fmt.Println(\\\"Hello, Go\\\")\",\n      \"}\",\n      \"\",\n      \"\"\n    ],\n    \"description\": \"Go Template \u0026 code snippets!\"\n  }\n}\n\n```\n\n\u003c!-- [want more](https://github.com/xgqfrms/vscode/tree/master/code-snippets) --\u003e\n\n\u003c!-- [want more](./code-snippets/readme.md) --\u003e\n\n[want more](./code-snippets#readme)\n\n\u003c!-- https://github.com/xgqfrms/vscode/issues --\u003e\n\n\n## VSCode useful Extensions All In One \n\n\n[VSCode useful Extensions All In One ](./plugins-extensions/readme.md)\n\n\u003c!--\n\n[VSCode useful Extensions All In One ](./plugins-extensions/readme.md)\n\n[VSCode useful Extensions All In One ](./plugins-extensions#readme)\n\n[VSCode useful Extensions All In One ](./plugins-extensions)\n\n\nhttps://github.com/xgqfrms/vscode/blob/master/\n--\u003e\n\n## refs\n\n\u003e vscode \u0026 code snippets\n\n[https://www.cnblogs.com/xgqfrms/p/9226993.html](https://www.cnblogs.com/xgqfrms/p/9226993.html)\n\n\n\n\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgqfrms%2Fvscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxgqfrms%2Fvscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgqfrms%2Fvscode/lists"}