Skip to content

Instantly share code, notes, and snippets.

@svaderia
Created March 18, 2020 11:01
Show Gist options
  • Select an option

  • Save svaderia/377e4edb888b222e01b9757984d80f87 to your computer and use it in GitHub Desktop.

Select an option

Save svaderia/377e4edb888b222e01b9757984d80f87 to your computer and use it in GitHub Desktop.
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-03-18T11:01:04.213Z","extensionVersion":"v3.4.3"}
[
{
"metadata": {
"id": "04208f17-8aed-4d49-b0a2-fbce829efbeb",
"publisherId": "xaver.clang-format",
"publisherDisplayName": "xaver"
},
"name": "clang-format",
"publisher": "xaver",
"version": "1.9.0"
},
{
"metadata": {
"id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd",
"publisherId": "Shan.code-settings-sync",
"publisherDisplayName": "Shan"
},
"name": "code-settings-sync",
"publisher": "Shan",
"version": "3.4.3"
},
{
"metadata": {
"id": "690b692e-e8a9-493f-b802-8089d50ac1b2",
"publisherId": "ms-vscode.cpptools",
"publisherDisplayName": "ms-vscode"
},
"name": "cpptools",
"publisher": "ms-vscode",
"version": "0.27.0-insiders3"
},
{
"metadata": {
"id": "8bb12ae3-73f8-40cf-86b7-4bd5729c6238",
"publisherId": "GrapeCity.gc-excelviewer",
"publisherDisplayName": "GrapeCity"
},
"name": "gc-excelviewer",
"publisher": "GrapeCity",
"version": "2.1.34"
},
{
"metadata": {
"id": "7f937559-a3c9-43e0-a62b-0008a5da127b",
"publisherId": "idleberg.hopscotch",
"publisherDisplayName": "idleberg"
},
"name": "hopscotch",
"publisher": "idleberg",
"version": "0.2.2"
},
{
"metadata": {
"id": "198a707e-28af-4e84-8610-6e2f628dd12d",
"publisherId": "redhat.java",
"publisherDisplayName": "redhat"
},
"name": "java",
"publisher": "redhat",
"version": "0.58.0"
},
{
"metadata": {
"id": "7b7b3431-6011-4543-bf78-47d369a53f19",
"publisherId": "DSnake.java-debug",
"publisherDisplayName": "DSnake"
},
"name": "java-debug",
"publisher": "DSnake",
"version": "0.0.2"
},
{
"metadata": {
"id": "1f5eb737-5496-44a3-a8a1-36a85eee4979",
"publisherId": "magicstack.MagicPython",
"publisherDisplayName": "magicstack"
},
"name": "MagicPython",
"publisher": "magicstack",
"version": "1.1.0"
},
{
"metadata": {
"id": "26a529c9-2654-4b95-a63f-02f6a52429e6",
"publisherId": "zhuangtongfa.material-theme",
"publisherDisplayName": "zhuangtongfa"
},
"name": "material-theme",
"publisher": "zhuangtongfa",
"version": "3.2.4"
},
{
"metadata": {
"id": "4386e6f6-ec10-4463-9d23-c24278718947",
"publisherId": "tomoki1207.pdf",
"publisherDisplayName": "tomoki1207"
},
"name": "pdf",
"publisher": "tomoki1207",
"version": "0.5.1"
},
{
"metadata": {
"id": "f1f59ae4-9318-4f3c-a9b5-81b2eaa5f8a5",
"publisherId": "ms-python.python",
"publisherDisplayName": "ms-python"
},
"name": "python",
"publisher": "ms-python",
"version": "2020.2.64397"
},
{
"metadata": {
"id": "8842cbf6-738b-423f-81a4-ae88fba2024c",
"publisherId": "tushortz.python-extended-snippets",
"publisherDisplayName": "tushortz"
},
"name": "python-extended-snippets",
"publisher": "tushortz",
"version": "0.0.1"
},
{
"metadata": {
"id": "6b98103e-0de0-4773-bd8c-00cd6da31089",
"publisherId": "Dmytro.racket",
"publisherDisplayName": "Dmytro"
},
"name": "racket",
"publisher": "Dmytro",
"version": "1.2.0"
},
{
"metadata": {
"id": "0d9c867f-c8bd-44ff-beb2-92dbe7d03aa0",
"publisherId": "swyphcosmo.spellchecker",
"publisherDisplayName": "swyphcosmo"
},
"name": "spellchecker",
"publisher": "swyphcosmo",
"version": "1.2.13"
},
{
"metadata": {
"id": "829a192d-496c-44ac-87f3-0a84ce36a853",
"publisherId": "emmanuelbeziat.vscode-great-icons",
"publisherDisplayName": "emmanuelbeziat"
},
"name": "vscode-great-icons",
"publisher": "emmanuelbeziat",
"version": "2.1.47"
},
{
"metadata": {
"id": "61fcd0cf-64d7-4836-8d6b-d55f4fb83281",
"publisherId": "vscjava.vscode-java-debug",
"publisherDisplayName": "vscjava"
},
"name": "vscode-java-debug",
"publisher": "vscjava",
"version": "0.25.1"
},
{
"metadata": {
"id": "7865e561-1c83-410e-9b99-aabada597a7e",
"publisherId": "vscjava.vscode-java-dependency",
"publisherDisplayName": "vscjava"
},
"name": "vscode-java-dependency",
"publisher": "vscjava",
"version": "0.9.0"
},
{
"metadata": {
"id": "96f11e1f-1a46-4592-b084-f025b2c2a81f",
"publisherId": "vscjava.vscode-java-pack",
"publisherDisplayName": "vscjava"
},
"name": "vscode-java-pack",
"publisher": "vscjava",
"version": "0.8.1"
},
{
"metadata": {
"id": "67c06b0d-1891-42ca-b2a8-113e79bff069",
"publisherId": "vscjava.vscode-java-test",
"publisherDisplayName": "vscjava"
},
"name": "vscode-java-test",
"publisher": "vscjava",
"version": "0.22.2"
},
{
"metadata": {
"id": "b0f06c6b-24fb-4d7b-bd79-bc5e2fa17312",
"publisherId": "vscjava.vscode-maven",
"publisherDisplayName": "vscjava"
},
"name": "vscode-maven",
"publisher": "vscjava",
"version": "0.21.1"
},
{
"metadata": {
"id": "876e8f93-74d0-4f4f-91b7-34a09f19f444",
"publisherId": "VisualStudioExptTeam.vscodeintellicode",
"publisherDisplayName": "VisualStudioExptTeam"
},
"name": "vscodeintellicode",
"publisher": "VisualStudioExptTeam",
"version": "1.2.6"
}
]
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+down",
"command": "cursorEnd",
"when": "editorTextFocus"
},
{
"key": "end",
"command": "-cursorEnd",
"when": "editorTextFocus"
},
{
"key": "ctrl+up",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "home",
"command": "-cursorHome",
"when": "editorTextFocus"
}
]
// Place your settings in this file to overwrite the default settings
{
"window.zoomLevel": 0,
"spellchecker.ignoreWordsList": [
"blog",
"config",
"Shyamal",
"vaderia",
"endhighlight"
],
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-great-icons",
"terminal.integrated.shell.linux": "/usr/bin/zsh",
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": true
},
"python.linting.enabled": false,
"typescript.check.npmIsInstalled": false,
"editor.detectIndentation": false,
"problems.decorations.enabled": false,
"explorer.confirmDragAndDrop": false,
"terminal.integrated.cursorStyle": "line",
"terminal.external.linuxExec": "alacritty",
"terminal.external.osxExec": "alacritty",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.fontFamily": "SauceCodePro Nerd Font",
"editor.renderControlCharacters": false,
"python.jediEnabled": false,
"terminal.integrated.rendererType": "canvas",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"C_Cpp.updateChannel": "Insiders",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"editor.minimap.enabled": false,
"breadcrumbs.enabled": true,
}
{
// Place your snippets for c 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"
// }
"For compiler project" : {
"prefix": "elif",
"body": [
"else if( root -> ele.nt == ${1:NT}){",
" Tnode* child = root -> child;",
" Anode* node = $2;",
" return node;",
"}"
],
"description": "YOLO"
}
}
{
// Place your snippets for cpp 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"
// }
"Union Find": {
"prefix": "dsu",
"body": [
"//Class to implement union find using path compression",
"//1-based indexing assumed",
"",
"class UnionFind {",
"private:",
" int n, set_size, *parent, *rank;",
"public:",
" //Complexity: O(n)",
" UnionFind(int a) {",
" n = set_size = a;",
" parent = new int[n+1];",
" rank = new int[n+1];",
" for(int i = 1; i <= n; ++i) parent[i]=i, rank[i]=1;",
" }",
" ~UnionFind() {",
" delete rank;",
" delete parent;",
" }",
" //Path Compression",
" int find(int x) {",
" if (x != parent[x]) return parent[x] = find(parent[x]);",
" return x;",
" }",
" //Complexity : O(A N), where A = Inverse Ackermann function",
" void unite(int x, int y) {",
" int xroot = find(x), yroot = find(y);",
" if (xroot != yroot) {",
" if (rank[xroot] >= rank[yroot]) {",
" parent[yroot] = xroot;",
" rank[xroot] += rank[yroot];",
" }",
" else {",
" parent[xroot] = yroot;",
" rank[yroot] += rank[xroot];",
" }",
" set_size -= 1;",
" }",
" }",
" int size() { return set_size; }",
" void print() {",
" for(int i = 1; i <= n; ++i)",
" cout << i << \" -> \" << parent[i] << \"\\n\";",
" }",
"};"
],
"description": "Union Find"
}
"Check if prime": {
"prefix": "isprime",
"body": [
"",
"bool is_prime(int n){",
" bool yeah = true;",
" if( n <= 1){",
" yeah = false;",
" }else{",
" int temp = int(ceil(sqrt(n)));",
" for(int i = 2; i < temp; i++){",
" if(n % i == 0){",
" yeah = false;",
" break;",
" }",
" }",
" if( temp * temp == n){",
" yeah = false;",
" }",
" }",
"",
" return yeah;",
"}"
],
"description": "Check if prime"
}
"get divisors": {
"prefix": "divisors",
"body": [
"void get_divisors(int n, vi &v){",
" int temp = int(ceil( sqrt(n)));",
" for(int i = 2; i < temp; i++){",
" if(n % i == 0){",
" v.pb(i);",
" v.pb(n/i);",
" }",
" }",
" if(temp * temp == n){",
" v.pb(temp);",
" }",
" ",
"}"
],
"description": "get divisors"
}
"Segment Tree": {
"prefix": "segtree",
"body": [
"",
"const int MAXN = 100005;",
"int arr[MAXN];",
"int seg[4 * MAXN];",
"int N;",
"",
"//Complexity: O(1)",
"//Stores what info. segment[i..j] should store",
"int combine(int &a, int &b) {",
" return a + b;",
"}",
"",
"//Complexity: O(n)",
"void build(int id = 1, int l = 0, int r = N){",
" if(r - l < 2){",
" //base case : leaf node information to be stored here",
" seg[id] = arr[l];",
" return;",
" }",
"",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" build(left, l, mid);",
" build(right, mid, r);",
" seg[id] = combine(seg[left], seg[right]);",
"}",
"",
"//Complexity: O(log n)",
"void update(int p, int y, int id = 1, int l = 0, int r = N){",
" if(r - l < 2){ ",
" //base case : leaf node information to be stored here",
" seg[id] = y;",
" return;",
" }",
"",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" if(p < mid){",
" update(p, y, left, l, mid);",
" }else{",
" update(p, y, right, mid, r);",
" }",
" seg[id] = combine(seg[left], seg[right]);",
"}",
"",
"//Complexity: O(log n)",
"int query(int x, int y, int id = 1, int l = 0, int r = N){",
" if(r <= x || y <= l){ // No overlap, return useless",
" return 0;",
" }",
"",
" if(x <= l && r <= y){ // overlap",
" return seg[id];",
" }",
"",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" int a = query(x, y, left, l, mid);",
" int b = query(x, y, right, mid, r);",
" return combine(a, b);",
"}",
""
],
"description": "Segment Tree"
}
"Segment Tree Lazy": {
"prefix": "segtreelazy",
"body": [
"//Segment tree operations: Range update(Lazy propagation) and Range Query",
"",
"const int MAXN = 100005;",
"int arr[MAXN];",
"int seg[4 * MAXN];",
"int lazy[4 * MAXN];",
"bool push[4 * MAXN];",
"int N;",
"",
"//Complexity: O(1)",
"//Stores what info. segment[i..j] should store",
"int combine(int &a, int &b) {",
" return max(a, b);",
"}",
"",
"//Lazy propagation",
"void propagate(int id, int l, int r) {",
" if (push[id]) {",
" seg[id] += lazy[id];",
" int left = 2 * id, right = left + 1;",
" if (r - l >= 2) {",
" push[left] = true;",
" push[right] = true;",
" lazy[left] += lazy[id];",
" lazy[right] += lazy[id];",
" }",
" push[id] = false;",
" lazy[id] = 0;",
" }",
"}",
"",
"//Complexity: O(n)",
"void build(int id = 1, int l = 0, int r = N) {",
" push[id] = false;",
" lazy[id] = 0;",
" if (r - l < 2) {",
" //base case : leaf node information to be stored here",
" seg[id] = arr[l];",
" return ;",
" }",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" build(left, l, mid);",
" build(right, mid, r);",
" seg[id] = combine(seg[left], seg[right]);",
"}",
"",
"//Complexity: O(log n)",
"void update(int x, int y, int val, int id = 1, int l = 0, int r = N) {",
" propagate(id, l, r);",
" if (r <= x || y <= l) {",
" return ;",
" }",
" if (x <= l && r <= y) {",
" //base case : leaf node information to be stored here",
" lazy[id] += val;",
" push[id] = true;",
" propagate(id, l, r);",
" return ;",
" }",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" update(x, y, val, left, l, mid);",
" update(x, y, val, right, mid, r);",
" seg[id] = combine(seg[left], seg[right]);",
"}",
"",
"//Complexity: O(log n)",
"int query(int x, int y, int id = 1, int l = 0, int r = N) {",
" propagate(id, l, r);",
" if(r <= x || y <= l){ // No overlap, return useless",
" return 0;",
" }",
"",
" if(x <= l && r <= y){ // overlap",
" return seg[id];",
" }",
"",
" int mid = (l + r) / 2;",
" int left = 2 * id, right = left + 1;",
" int a = query(x, y, left, l, mid);",
" int b = query(x, y, right, mid, r);",
" return combine(a, b);",
"}"
],
"description": "Segment Tree Lazy"
}
}
{
"highlight":{
"prefix" : "ghi",
"body": [
"{% highlight $1 %}",
"$2",
"{% endhighlight %}"
],
"description": "Hightlight the code snippet"
}
/*
// Place your snippets for Markdown 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"
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment