Skip to content

Instantly share code, notes, and snippets.

@goldbergyoni
Last active September 23, 2018 09:34
Show Gist options
  • Select an option

  • Save goldbergyoni/5c6ab7a67f2fcfcb8d74d46904e25f33 to your computer and use it in GitHub Desktop.

Select an option

Save goldbergyoni/5c6ab7a67f2fcfcb8d74d46904e25f33 to your computer and use it in GitHub Desktop.
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-23T09:34:34.812Z","extensionVersion":"v3.1.2"}
[
{
"metadata": {
"id": "70378119-1d85-4935-9733-0298c7a369a2",
"publisherId": "steoates.autoimport",
"publisherDisplayName": "steoates"
},
"name": "autoimport",
"publisher": "steoates",
"version": "1.5.3"
},
{
"metadata": {
"id": "819a23e1-b6c6-41cf-9029-e653b537d996",
"publisherId": "ms-vscode.azure-account",
"publisherDisplayName": "ms-vscode"
},
"name": "azure-account",
"publisher": "ms-vscode",
"version": "0.4.3"
},
{
"metadata": {
"id": "697255a9-3f36-44c8-b084-d3b91edfb23a",
"publisherId": "HookyQR.beautify",
"publisherDisplayName": "HookyQR"
},
"name": "beautify",
"publisher": "HookyQR",
"version": "1.4.4"
},
{
"metadata": {
"id": "b689fcc8-d494-4dbf-a228-2c694a578afc",
"publisherId": "alefragnani.Bookmarks",
"publisherDisplayName": "alefragnani"
},
"name": "Bookmarks",
"publisher": "alefragnani",
"version": "9.1.0"
},
{
"metadata": {
"id": "dbfcaca2-cabd-47ce-91f3-8e1276d2b50f",
"publisherId": "nwhatt.chai-snippets",
"publisherDisplayName": "nwhatt"
},
"name": "chai-snippets",
"publisher": "nwhatt",
"version": "0.1.0"
},
{
"metadata": {
"id": "a6a0c5b2-d078-4bf5-a9ee-4e37054414b3",
"publisherId": "formulahendry.code-runner",
"publisherDisplayName": "formulahendry"
},
"name": "code-runner",
"publisher": "formulahendry",
"version": "0.9.4"
},
{
"metadata": {
"id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd",
"publisherId": "Shan.code-settings-sync",
"publisherDisplayName": "Shan"
},
"name": "code-settings-sync",
"publisher": "Shan",
"version": "3.1.2"
},
{
"metadata": {
"id": "f6dbd813-b0a0-42c1-90ea-10dde9d925a7",
"publisherId": "streetsidesoftware.code-spell-checker",
"publisherDisplayName": "streetsidesoftware"
},
"name": "code-spell-checker",
"publisher": "streetsidesoftware",
"version": "1.6.10"
},
{
"metadata": {
"id": "1ec62ca5-d7f9-4ddb-a882-e8d018c0aefd",
"publisherId": "msjsdiag.debugger-for-chrome",
"publisherDisplayName": "msjsdiag"
},
"name": "debugger-for-chrome",
"publisher": "msjsdiag",
"version": "4.10.1"
},
{
"metadata": {
"id": "b2e38b45-9774-4972-950d-5d5d0844263b",
"publisherId": "tariky.easy-snippet-maker",
"publisherDisplayName": "tariky"
},
"name": "easy-snippet-maker",
"publisher": "tariky",
"version": "0.0.6"
},
{
"metadata": {
"id": "c32bc09b-8525-4d9d-a3da-7f46d8f1858f",
"publisherId": "vladmrnv.expresssnippet",
"publisherDisplayName": "vladmrnv"
},
"name": "expresssnippet",
"publisher": "vladmrnv",
"version": "0.2.4"
},
{
"metadata": {
"id": "24107fa3-c33a-4f36-b225-21775b32199f",
"publisherId": "letmaik.git-tree-compare",
"publisherDisplayName": "letmaik"
},
"name": "git-tree-compare",
"publisher": "letmaik",
"version": "1.3.0"
},
{
"metadata": {
"id": "5960f38e-0bbe-4644-8f9c-9c8824e82511",
"publisherId": "donjayamanne.githistory",
"publisherDisplayName": "donjayamanne"
},
"name": "githistory",
"publisher": "donjayamanne",
"version": "0.4.2"
},
{
"metadata": {
"id": "a2cec723-5349-460d-9de9-0fd1f8d3456f",
"publisherId": "xabikos.JavaScriptSnippets",
"publisherDisplayName": "xabikos"
},
"name": "JavaScriptSnippets",
"publisher": "xabikos",
"version": "1.7.0"
},
{
"metadata": {
"id": "b5358333-f5a4-4ebb-93a3-46e0d4cb2ea1",
"publisherId": "alefragnani.jenkins-status",
"publisherDisplayName": "alefragnani"
},
"name": "jenkins-status",
"publisher": "alefragnani",
"version": "2.2.0"
},
{
"metadata": {
"id": "0229f987-83fd-4576-aa7f-566747840393",
"publisherId": "secanis.jenkinsfile-support",
"publisherDisplayName": "secanis"
},
"name": "jenkinsfile-support",
"publisher": "secanis",
"version": "0.1.0"
},
{
"metadata": {
"id": "8ee0c715-ca9e-4ce2-8841-5faa5e0f3255",
"publisherId": "andys8.jest-snippets",
"publisherDisplayName": "andys8"
},
"name": "jest-snippets",
"publisher": "andys8",
"version": "1.5.1"
},
{
"metadata": {
"id": "3bafbaa9-02d6-454c-ad91-5b7382597cb9",
"publisherId": "TomiTurtiainen.js-complexity-analysis",
"publisherDisplayName": "TomiTurtiainen"
},
"name": "js-complexity-analysis",
"publisher": "TomiTurtiainen",
"version": "2.0.0"
},
{
"metadata": {
"id": "236ff452-49f5-47a4-8928-ab18f5b9c7bf",
"publisherId": "eriklynd.json-tools",
"publisherDisplayName": "eriklynd"
},
"name": "json-tools",
"publisher": "eriklynd",
"version": "1.0.2"
},
{
"metadata": {
"id": "0b0e4305-3ab6-4928-bce6-081b5f146df7",
"publisherId": "GregorBiswanger.json2ts",
"publisherDisplayName": "GregorBiswanger"
},
"name": "json2ts",
"publisher": "GregorBiswanger",
"version": "0.0.6"
},
{
"metadata": {
"id": "74f34f8a-245e-4133-8617-a3a94b5a417e",
"publisherId": "cmstead.jsrefactor",
"publisherDisplayName": "cmstead"
},
"name": "jsrefactor",
"publisher": "cmstead",
"version": "2.14.1"
},
{
"metadata": {
"id": "1bf2afc4-296d-482b-89ff-3318c474a2a8",
"publisherId": "ipedrazas.kubernetes-snippets",
"publisherDisplayName": "ipedrazas"
},
"name": "kubernetes-snippets",
"publisher": "ipedrazas",
"version": "0.1.9"
},
{
"metadata": {
"id": "d002d11c-7c09-4497-9da9-093798ae0ded",
"publisherId": "dollyn.line-counter",
"publisherDisplayName": "dollyn"
},
"name": "line-counter",
"publisher": "dollyn",
"version": "0.5.2"
},
{
"metadata": {
"id": "c6a25fb4-b02a-4cb3-95c2-bb77763f1423",
"publisherId": "yycalm.linecount",
"publisherDisplayName": "yycalm"
},
"name": "linecount",
"publisher": "yycalm",
"version": "0.1.7"
},
{
"metadata": {
"id": "cd9480c7-b1ec-4528-9c9e-e1e1d71c3652",
"publisherId": "hdg.live-html-previewer",
"publisherDisplayName": "hdg"
},
"name": "live-html-previewer",
"publisher": "hdg",
"version": "0.3.0"
},
{
"metadata": {
"id": "25adc849-5c3a-4dca-95b3-55a6461077ee",
"publisherId": "xyz.local-history",
"publisherDisplayName": "xyz"
},
"name": "local-history",
"publisher": "xyz",
"version": "1.7.0"
},
{
"metadata": {
"id": "e8b488af-fccf-4adf-b60c-fc7455bea107",
"publisherId": "emilast.LogFileHighlighter",
"publisherDisplayName": "emilast"
},
"name": "LogFileHighlighter",
"publisher": "emilast",
"version": "2.4.1"
},
{
"metadata": {
"id": "98790d67-10fa-497c-9113-f6c7489207b2",
"publisherId": "yzhang.markdown-all-in-one",
"publisherDisplayName": "yzhang"
},
"name": "markdown-all-in-one",
"publisher": "yzhang",
"version": "1.6.0"
},
{
"metadata": {
"id": "9f47c6a1-da06-41ce-ba18-5e281296aa0a",
"publisherId": "stringham.move-ts",
"publisherDisplayName": "stringham"
},
"name": "move-ts",
"publisher": "stringham",
"version": "1.11.3"
},
{
"metadata": {
"id": "150d948d-57be-4d27-992c-0b6a9f36cde6",
"publisherId": "prashaantt.node-tdd",
"publisherDisplayName": "prashaantt"
},
"name": "node-tdd",
"publisher": "prashaantt",
"version": "0.2.4"
},
{
"metadata": {
"id": "fc5a3c47-de02-420d-9326-eddc9ba38f04",
"publisherId": "waderyan.nodejs-extension-pack",
"publisherDisplayName": "waderyan"
},
"name": "nodejs-extension-pack",
"publisher": "waderyan",
"version": "0.1.9"
},
{
"metadata": {
"id": "dff6b801-247e-40e9-82e8-8c9b1d19d1b8",
"publisherId": "christian-kohler.npm-intellisense",
"publisherDisplayName": "christian-kohler"
},
"name": "npm-intellisense",
"publisher": "christian-kohler",
"version": "1.3.0"
},
{
"metadata": {
"id": "a41c1549-4053-44d4-bf30-60fc809b4a86",
"publisherId": "christian-kohler.path-intellisense",
"publisherDisplayName": "christian-kohler"
},
"name": "path-intellisense",
"publisher": "christian-kohler",
"version": "1.4.2"
},
{
"metadata": {
"id": "96fa4707-6983-4489-b7c5-d5ffdfdcce90",
"publisherId": "esbenp.prettier-vscode",
"publisherDisplayName": "esbenp"
},
"name": "prettier-vscode",
"publisher": "esbenp",
"version": "1.6.1"
},
{
"metadata": {
"id": "03e014a0-a915-4672-92b3-77e5a6ad72df",
"publisherId": "searKing.preview-vscode",
"publisherDisplayName": "searKing"
},
"name": "preview-vscode",
"publisher": "searKing",
"version": "1.4.4"
},
{
"metadata": {
"id": "f1f59ae4-9318-4f3c-a9b5-81b2eaa5f8a5",
"publisherId": "ms-python.python",
"publisherDisplayName": "ms-python"
},
"name": "python",
"publisher": "ms-python",
"version": "2018.8.0"
},
{
"metadata": {
"id": "aae0701b-111f-49c1-9000-abd37a442f28",
"publisherId": "WallabyJs.quokka-vscode",
"publisherDisplayName": "WallabyJs"
},
"name": "quokka-vscode",
"publisher": "WallabyJs",
"version": "1.0.149"
},
{
"metadata": {
"id": "ee108066-df8b-43ae-9a83-e6c11400a759",
"publisherId": "jasonnutter.search-node-modules",
"publisherDisplayName": "jasonnutter"
},
"name": "search-node-modules",
"publisher": "jasonnutter",
"version": "1.3.0"
},
{
"metadata": {
"id": "d6ba4b7b-539f-456a-b0f6-0348df44cdf3",
"publisherId": "nikitaKunevich.snippet-creator",
"publisherDisplayName": "nikitaKunevich"
},
"name": "snippet-creator",
"publisher": "nikitaKunevich",
"version": "0.0.5"
},
{
"metadata": {
"id": "f5d7ffda-c1d6-4070-ba80-803c705a1ee6",
"publisherId": "monokai.theme-monokai-pro-vscode",
"publisherDisplayName": "monokai"
},
"name": "theme-monokai-pro-vscode",
"publisher": "monokai",
"version": "1.1.8"
},
{
"metadata": {
"id": "c62f9345-3742-4644-bbe5-0ceffc00c775",
"publisherId": "loiane.ts-extension-pack",
"publisherDisplayName": "loiane"
},
"name": "ts-extension-pack",
"publisher": "loiane",
"version": "0.1.0"
},
{
"metadata": {
"id": "6bc1e3ad-c0e2-46b6-bbad-246c5f59215b",
"publisherId": "pmneo.tsimporter",
"publisherDisplayName": "pmneo"
},
"name": "tsimporter",
"publisher": "pmneo",
"version": "1.2.14"
},
{
"metadata": {
"id": "513cf511-3894-4ee2-8c34-13ab83ddfd37",
"publisherId": "eg2.tslint",
"publisherDisplayName": "eg2"
},
"name": "tslint",
"publisher": "eg2",
"version": "1.0.39"
},
{
"metadata": {
"id": "38583aca-2ba1-417f-80fc-68ca8d717fb4",
"publisherId": "rbbit.typescript-hero",
"publisherDisplayName": "rbbit"
},
"name": "typescript-hero",
"publisher": "rbbit",
"version": "2.3.2"
},
{
"metadata": {
"id": "450d63ed-8ac6-4694-b26e-77cb20bcb25e",
"publisherId": "qinjia.view-in-browser",
"publisherDisplayName": "qinjia"
},
"name": "view-in-browser",
"publisher": "qinjia",
"version": "0.0.5"
},
{
"metadata": {
"id": "d7b592dd-41c9-4f2b-acf3-055ae65e55c6",
"publisherId": "dzannotti.vscode-babel-coloring",
"publisherDisplayName": "dzannotti"
},
"name": "vscode-babel-coloring",
"publisher": "dzannotti",
"version": "0.0.4"
},
{
"metadata": {
"id": "0241650e-9ef3-4559-9411-175ba915dc35",
"publisherId": "jvandyke.vscode-circleci",
"publisherDisplayName": "jvandyke"
},
"name": "vscode-circleci",
"publisher": "jvandyke",
"version": "0.5.0"
},
{
"metadata": {
"id": "4dd4cb5f-8946-4882-bf7c-e5997ab40481",
"publisherId": "kisstkondoros.vscode-codemetrics",
"publisherDisplayName": "kisstkondoros"
},
"name": "vscode-codemetrics",
"publisher": "kisstkondoros",
"version": "1.17.1"
},
{
"metadata": {
"id": "726dd888-7465-4e27-a016-4288df7be24a",
"publisherId": "KnisterPeter.vscode-commitizen",
"publisherDisplayName": "KnisterPeter"
},
"name": "vscode-commitizen",
"publisher": "KnisterPeter",
"version": "0.5.0"
},
{
"metadata": {
"id": "188277b8-e4bc-4c10-92fa-d6959b4243ea",
"publisherId": "ryanluker.vscode-coverage-gutters",
"publisherDisplayName": "ryanluker"
},
"name": "vscode-coverage-gutters",
"publisher": "ryanluker",
"version": "2.2.0"
},
{
"metadata": {
"id": "0479fc1c-3d67-49f9-b087-fb9069afe48f",
"publisherId": "PeterJausovec.vscode-docker",
"publisherDisplayName": "PeterJausovec"
},
"name": "vscode-docker",
"publisher": "PeterJausovec",
"version": "0.2.0"
},
{
"metadata": {
"id": "583b2b34-2c1e-4634-8c0b-0b82e283ea3a",
"publisherId": "dbaeumer.vscode-eslint",
"publisherDisplayName": "dbaeumer"
},
"name": "vscode-eslint",
"publisher": "dbaeumer",
"version": "1.6.0"
},
{
"metadata": {
"id": "186f769a-7380-4c03-8eb1-2aaa52a203ec",
"publisherId": "miramac.vscode-exec-node",
"publisherDisplayName": "miramac"
},
"name": "vscode-exec-node",
"publisher": "miramac",
"version": "0.5.0"
},
{
"metadata": {
"id": "c9ebdde4-f0a3-4405-9161-f18711c6f883",
"publisherId": "technosophos.vscode-helm",
"publisherDisplayName": "technosophos"
},
"name": "vscode-helm",
"publisher": "technosophos",
"version": "0.3.0"
},
{
"metadata": {
"id": "9ccc1dd7-7ec4-4a46-bd4f-7d7b8b9d322a",
"publisherId": "robertohuertasm.vscode-icons",
"publisherDisplayName": "robertohuertasm"
},
"name": "vscode-icons",
"publisher": "robertohuertasm",
"version": "7.26.0"
},
{
"metadata": {
"id": "4837e4f3-1b01-4732-b1a6-daa57ef64cab",
"publisherId": "ms-kubernetes-tools.vscode-kubernetes-tools",
"publisherDisplayName": "ms-kubernetes-tools"
},
"name": "vscode-kubernetes-tools",
"publisher": "ms-kubernetes-tools",
"version": "0.1.14"
},
{
"metadata": {
"id": "6fc9fa34-b8b2-4071-9a0d-3eeb81cd9cfb",
"publisherId": "fknop.vscode-npm",
"publisherDisplayName": "fknop"
},
"name": "vscode-npm",
"publisher": "fknop",
"version": "3.3.0"
},
{
"metadata": {
"id": "d7ffabfa-4c17-4635-b905-309b6470cc35",
"publisherId": "howardzuo.vscode-npm-dependency",
"publisherDisplayName": "howardzuo"
},
"name": "vscode-npm-dependency",
"publisher": "howardzuo",
"version": "1.2.0"
},
{
"metadata": {
"id": "ae9e3eb0-3357-4cc0-90ee-598d2d384757",
"publisherId": "eg2.vscode-npm-script",
"publisherDisplayName": "eg2"
},
"name": "vscode-npm-script",
"publisher": "eg2",
"version": "0.3.5"
},
{
"metadata": {
"id": "201ac50a-7bd7-4097-8a48-4544ea6bb82b",
"publisherId": "adambaldwin.vscode-nsp",
"publisherDisplayName": "adambaldwin"
},
"name": "vscode-nsp",
"publisher": "adambaldwin",
"version": "1.0.1"
},
{
"metadata": {
"id": "cc0f79fb-4717-43cb-9961-8076b6874559",
"publisherId": "pmbenjamin.vscode-snyk",
"publisherDisplayName": "pmbenjamin"
},
"name": "vscode-snyk",
"publisher": "pmbenjamin",
"version": "0.0.2"
},
{
"metadata": {
"id": "55066e9b-6d65-4803-97e2-33316bef79e8",
"publisherId": "Tyriar.vscode-terminal-here",
"publisherDisplayName": "Tyriar"
},
"name": "vscode-terminal-here",
"publisher": "Tyriar",
"version": "0.1.1"
},
{
"metadata": {
"id": "2061917f-f76a-458a-8da9-f162de22b97e",
"publisherId": "redhat.vscode-yaml",
"publisherDisplayName": "redhat"
},
"name": "vscode-yaml",
"publisher": "redhat",
"version": "0.0.16"
},
{
"metadata": {
"id": "6766254a-8e43-4ebc-9b89-e5be39cb5318",
"publisherId": "WallabyJs.wallaby-vscode",
"publisherDisplayName": "WallabyJs"
},
"name": "wallaby-vscode",
"publisher": "WallabyJs",
"version": "1.0.93"
},
{
"metadata": {
"id": "c3d9396e-9043-4351-896e-cec7ab4f8c54",
"publisherId": "adamvoss.yaml",
"publisherDisplayName": "adamvoss"
},
"name": "yaml",
"publisher": "adamvoss",
"version": "0.0.9"
}
]
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+l",
"command": "workbench.action.terminal.focusPrevious"
},
{
"key": "ctrl+shift+z",
"command": "workbench.action.toggleZenMode"
},
{
"key": "ctrl+k z",
"command": "-workbench.action.toggleZenMode"
},
{
"key": "ctrl+shift+alt+k",
"command": "workbench.action.terminal.kill"
}
]
{
// Defines VSCode's display language.
// See https://go.microsoft.com/fwlink/?LinkId=761051 for a list of supported languages.
// Changing the value requires restarting VSCode.
"locale":"en"
}
{
"workbench.colorTheme": "Monokai Pro (Filter Octagon)",
"mocha.env": {
"NODE_ENV": "development"
},
"window.zoomLevel": 1,
"workbench.iconTheme": "vscode-icons",
"git.enableSmartCommit": true,
"editor.minimap.enabled": false,
"jenkins.polling": 1,
"files.autoSave": "afterDelay",
"git.autofetch": true,
"mocha.files.glob": "**/test*.js",
"sync.gist": "5c6ab7a67f2fcfcb8d74d46904e25f33",
"sync.lastUpload": "2018-06-26T08:18:46.132Z",
"sync.autoDownload": false,
"sync.autoUpload": true,
"sync.lastDownload": "",
"sync.forceDownload": false,
"sync.anonymousGist": false,
"sync.host": "",
"sync.pathPrefix": "",
"sync.quietSync": false,
"sync.askGistName": false,
"sync.removeExtensions": true,
"sync.syncExtensions": true,
"vsicons.projectDetection.autoReload": true,
"vsicons.dontShowNewVersionMessage": true,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
"explorer.confirmDragAndDrop": false
}
{
"nbp-express-middleware": {
"prefix": "nbp-express-middleware",
"body": [
"app.use((req,res,next)=>{",
"${1:middleware code}",
"});"
],
"description": "Add middleware to app variable"
},
"nbp-express-bodyparser": {
"prefix": "nbp-express-bodyparser",
"body": [
"var bodyParser = require('body-parser');",
"app.use(",
"bodyParser.urlencoded({",
"extended: true",
"})",
");",
"app.use(bodyParser.json());"
],
"description": "Add middleware to app variable"
},
"nbp-express-poweredby": {
"prefix": "nbp-express-poweredby",
"body": [
"res.removeHeader('X-Powered-By')"
],
"description": "Remove poweredby header"
},
"nbp-promise-catch": {
"prefix": "nbp-promise-catch",
"body": [
".catch(error => {\r",
" console.log(`Promise error found ${error} ${error.stack}`);\r",
" });"
],
"description": "nbp-promise-catch"
},
"nbp-promise-createall": {
"prefix": "nbp-promise-createall",
"body": [
"if (options.translate) {\r",
" getProductPromises.push(getTranslatedProduct.bind(order.id)());\r",
"} else {\r",
" getProductPromises.push(getProduct.bind(order.id)());\r",
"}\r",
"});\r",
"Promise.all(getProductPromises).then(allProducts => {\r",
"resolve(allProducts);\r",
"});\r",
""
],
"description": "nbp-promise-createall"
},
"nbp-errors-custom-constrcutor": {
"prefix": "nbp-errors-custom-constrcutor",
"body": [
"super(...params);\r",
" Error.captureStackTrace(this, CustomError);\r",
" this.date = new Date();\r",
" this.isOperational = isOperational;\r",
" this.message = message;"
],
"description": "nbp-errors-custom-constrcutor"
},
"nbp-error-handler-uncaught": {
"prefix": "nbp-error-handler-uncaught",
"body": [
"process.on(\"uncaughtException\", error => {\r",
" console.log(`Uncaught error is now handled ${error}`);\r",
" });"
],
"description": "nbp-error-handler-uncaught"
},
"nbp-error-handler-unhandled": {
"prefix": "nbp-error-handler-unhandled",
"body": [
"process.on(\"unhandledRejection\", (reason, p) => {\r",
" console.log(`Uncaught promise is now handled ${error}`);\r",
" });"
],
"description": "nbp-error-handler-unhandled"
},
"nbp-error-handler-handle": {
"prefix": "nbp-error-handler-handle",
"body": [
"handleError(error) {\r",
" //send right status code to caller\r",
"\r",
" //log error\r",
" console.log(`Error is now being handled:`);\r",
" console.log(error);\r",
"\r",
" //decide whether to crash\r",
" if(!error.isOperational)\r",
" process.exit(1);\r",
" }"
],
"description": "nbp-error-handler-handle"
},
"nbp-error-thrower-custom": {
"prefix": "nbp-error-thrower-custom",
"body": [
"e() {\r",
" try {\r",
" throw new CustomError(\"InvalidInput\", true, \"This error should NOT crash the process\");\r",
" } catch (error) {\r",
" console.log(error);\r",
" }\r",
" }"
],
"description": "nbp-error-thrower-custom"
},
"nbp-test-run": {
"prefix": "nbp-test-run",
"body": [
"mocha **/test.*unit.js"
],
"description": "nbp-test-run"
},
"nbp-test-cover": {
"prefix": "nbp-test-cover",
"body": [
"nyc --default-excludes --all --reporter=html mocha **/test.*unit.js -R xunit-file"
],
"description": "nbp-test-cover"
},
"nbp-test-require": {
"prefix": "nbp-test-require",
"body": [
"const expect = require(\"chai\").expect;\r",
"const sinon = require(\"sinon\");"
],
"description": "nbp-test-require"
},
"nbp-test-initial": {
"prefix": "nbp-test-initial",
"body": [
"it(\"Under 1000 order, expect to be approved\", () => {\r",
" const result = new orderServiceUnderTest().add({});\r",
" if (!result.approved) throw new Error(\"Test failed\");\r",
"});\r",
"\r",
"it(\"Price is higher than 1000, expect not approved\", () => {\r",
" const result = new orderServiceUnderTest().add({\r",
" price: 1500\r",
" });\r",
" if (result.approved) throw new Error(\"Test failed\");\r",
"});\r",
"\r",
"it(\"Proving empty order, expect an error\", () => {\r",
" let errorFound = false;\r",
" try {\r",
" const result = new orderServiceUnderTest().add();\r",
" } catch (e) {\r",
" errorFound = true;\r",
" }\r",
" finally{\r",
" if(!errorFound)\r",
" throw new Error(\"Test failed\");\r",
" }\r",
"});"
],
"description": "nbp-test-initial"
},
"nbp-test-order-service": {
"prefix": "nbp-test-order-service",
"body": [
"class OrderService {\r",
"\r",
" add(order) {\r",
"\r",
" if (!order)\r",
" throw new Error(\"Bad boy!\")\r",
"\r",
" const result = order\r",
"\r",
" if (order.price > 1000) {\r",
" result.approved = false;\r",
" } else {\r",
" result.approved = true;\r",
" }\r",
"\r",
" new DAL().save(order);\r",
"\r",
" return result;\r",
" }\r",
"}\r",
"\r",
"class DAL{\r",
" save(order){\r",
" return new Promise((resolve, reject) => {\r",
" console.log('Save DAL is running now')\r",
" setTimeout(() => {\r",
" resolve(order);\r",
" }, 1000);\r",
" });\r",
" }\r",
"}\r",
"\r",
"module.exports.orderService = OrderService;\r",
"module.exports.orderDAL = DAL;\r",
""
],
"description": "nbp-test-order-service"
},
"nbp-test-supertest": {
"prefix": "nbp-test-supertest",
"body": [
"it('Under 1000 order, expect to be approved', () => {\r",
" request(require('./orderAPI'))\r",
" .post('/api/orders')\r",
" .send({\r",
" price: 100\r",
" })\r",
" .expect('Content-Type', /json/)\r",
" .expect(200)\r",
" .end(function (err, res) {cls\r",
" });\r",
" \r",
" })"
],
"description": "nbp-test-supertest"
},
"nbp-hello-students-drawimage": {
"prefix": "nbp-hello-students-drawimage",
"body": [
"terminal.drawImage( \"./goodmorning.jpg\" , \r",
" {shrink:{width: 20, height: 20 }},(err,image)=>{})"
],
"description": "nbp-hello-students-drawimage"
},
"nbp-hellostudents-loop": {
"prefix": "nbp-hellostudents-loop",
"body": [
"studentsArray.forEach(student => {\r",
" console.log(`Good morning ${student}`)\r",
"});"
],
"description": "nbp-hellostudents-loop"
},
"nbp-hellostudents-roll": {
"prefix": "nbp-hellostudents-roll",
"body": [
"const blessed = require('blessed')\r",
" , contrib = require('blessed-contrib')\r",
" , screen = blessed.screen()\r",
" , log = contrib.log(\r",
" { fg: \"green\"\r",
" , label: 'students' \r",
" , height: \"20%\"\r",
" , tags: true \r",
" , border: {type: \"line\", fg: \"cyan\"} })\r",
" \r",
"screen.append(log)\r",
"setInterval(function() {log.log(studentsArray[i]); i++}, 2000)"
],
"description": "nbp-hellostudents-roll"
}
}
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
}
*/
}
{
"nbp-promise-catch": {
"prefix": "nbp-promise-catch",
"body": [
".catch(error => {\r",
" console.log(`Promise error found ${error} ${error.stack}`);\r",
" });"
],
"description": "nbp-promise-catch"
},
"nbp-express-basic-auth": {
"prefix": "nbp-express-basic-auth",
"body": [
"global.sessions = [];\r",
"\r",
"const authenticate = (req, res, next) => {\r",
" const userId = global.sessions[req.headers.authorization];\r",
" console.log(\r",
" `Authorization header ${\r",
" req.headers.authorization\r",
" } is and the found user is ${userId}`\r",
" );\r",
" if (!userId) {\r",
" res.status(401).end();\r",
" } else {\r",
" req.user = userService.getUserById(userId);\r",
" next();\r",
" }\r",
"};\r",
"\r",
"app.use(\"/api\", authenticate);\r",
""
],
"description": "basic auth"
}
}
{
"nbp-express-poweredby": {
"prefix": "nbp-express-poweredby",
"body": [
""
],
"description": "nbp-express-poweredby"
},
"": {
"prefix": "nbp-test-run",
"body": [
"mocha **/test.*unit.js"
],
"description": "nbp-test-run"
},
"nbp-test-initial": {
"prefix": "nbp-test-initial",
"body": [
"it(\"Under 1000 order, expect to be approved\", () => {\r",
" const result = new orderServiceUnderTest().add({});\r",
" if (!result.approved) throw new Error(\"Test failed\");\r",
"});\r",
"\r",
"it(\"Price is higher than 1000, expect not approved\", () => {\r",
" const result = new orderServiceUnderTest().add({\r",
" price: 1500\r",
" });\r",
" if (result.approved) throw new Error(\"Test failed\");\r",
"});\r",
"\r",
"it(\"Proving empty order, expect an error\", () => {\r",
" let errorFound = false;\r",
" try {\r",
" const result = new orderServiceUnderTest().add();\r",
" } catch (e) {\r",
" errorFound = true;\r",
" }\r",
" finally{\r",
" if(!errorFound)\r",
" throw new Error(\"Test failed\");\r",
" }\r",
"});"
],
"description": "nbp-test-initial"
}
}
{"version":"7.27.0","status":0,"welcomeShown":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment