Skip to content

Instantly share code, notes, and snippets.

@stray-leone
Forked from syhw/dnn.py
Last active September 25, 2020 12:34
Show Gist options
  • Save stray-leone/88e3d12fd9c1c2e454f8 to your computer and use it in GitHub Desktop.
Save stray-leone/88e3d12fd9c1c2e454f8 to your computer and use it in GitHub Desktop.
vscode settings sync data
{"lastUpload":"2020-09-25T12:33:59.722Z","extensionVersion":"v3.4.3"}
[
{
"metadata": {
"id": "5a6e2b21-1d61-4acd-b31b-907f9c23f18a",
"publisherId": "CoenraadS.bracket-pair-colorizer-2",
"publisherDisplayName": "CoenraadS"
},
"name": "bracket-pair-colorizer-2",
"publisher": "CoenraadS",
"version": "0.2.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": "3acc06d9-1bc5-49e1-ae61-306118c95228",
"publisherId": "Stephanvs.dot",
"publisherDisplayName": "Stephanvs"
},
"name": "dot",
"publisher": "Stephanvs",
"version": "0.0.1"
},
{
"metadata": {
"id": "17d45560-0c70-4fb6-b157-9ecc85d8e5a0",
"publisherId": "inu1255.easy-snippet",
"publisherDisplayName": "inu1255"
},
"name": "easy-snippet",
"publisher": "inu1255",
"version": "0.6.2"
},
{
"metadata": {
"id": "c941a679-d500-46a8-b2a9-208063125901",
"publisherId": "wholroyd.jinja",
"publisherDisplayName": "wholroyd"
},
"name": "jinja",
"publisher": "wholroyd",
"version": "0.0.8"
},
{
"metadata": {
"id": "113b22c8-8125-42ec-8c6b-80c3f5d5fa5f",
"publisherId": "IBM.output-colorizer",
"publisherDisplayName": "IBM"
},
"name": "output-colorizer",
"publisher": "IBM",
"version": "0.1.2"
},
{
"metadata": {
"id": "607fd052-be03-4363-b657-2bd62b83d28a",
"publisherId": "ms-vscode-remote.remote-ssh",
"publisherDisplayName": "ms-vscode-remote"
},
"name": "remote-ssh",
"publisher": "ms-vscode-remote",
"version": "0.55.0"
},
{
"metadata": {
"id": "bfeaf631-bcff-4908-93ed-fda4ef9a0c5c",
"publisherId": "ms-vscode-remote.remote-ssh-edit",
"publisherDisplayName": "ms-vscode-remote"
},
"name": "remote-ssh-edit",
"publisher": "ms-vscode-remote",
"version": "0.55.0"
},
{
"metadata": {
"id": "51cd7dfb-14fa-4fcc-aa42-16add9281456",
"publisherId": "SimonSiefke.svg-preview",
"publisherDisplayName": "SimonSiefke"
},
"name": "svg-preview",
"publisher": "SimonSiefke",
"version": "2.8.3"
},
{
"metadata": {
"id": "d96e79c6-8b25-4be3-8545-0e0ecefcae03",
"publisherId": "vscodevim.vim",
"publisherDisplayName": "vscodevim"
},
"name": "vim",
"publisher": "vscodevim",
"version": "1.17.0"
},
{
"metadata": {
"id": "7e72252f-e749-4e4a-bc6a-4a8cc2d121bd",
"publisherId": "thebarkman.vscode-djaneiro",
"publisherDisplayName": "thebarkman"
},
"name": "vscode-djaneiro",
"publisher": "thebarkman",
"version": "1.4.2"
}
]
// Place your key bindings in this file to override the defaults
[
// parenthesis, bracket
{
"key": "ctrl+k ctrl+u",
"command": "extension.embraceParenthesis",
"when": "editorHasSelection && editorTextFocus"
},
{
"key": "ctrl+k ctrl+i",
"command": "extension.embraceSquareBrackets",
"when": "editorHasSelection && editorTextFocus"
},
{
"key": "ctrl+k ctrl+o",
"command": "extension.embraceCurlyBrackets",
"when": "editorHasSelection && editorTextFocus"
},
{
"key": "ctrl+k ctrl+p",
"command": "extension.embraceAngleBrackets",
"when": "editorHasSelection && editorTextFocus"
},
// quote
{
"key": "ctrl+k ctrl+j",
"command": "extension.embraceSingleQuotes",
"when": "editorHasSelection && editorTextFocus"
},
{
"key": "ctrl+k ctrl+k",
"command": "extension.embraceDoubleQuotes",
"when": "editorHasSelection && editorTextFocus"
},
// insert <tab> manually
{
"key": "ctrl+tab",
"command": "type",
"args": { "text": "\t" },
"when": "editorTextFocus"
}
]
{
"remote.SSH.remotePlatform": {
"csb72068": "linux",
"cdev56.nlpr.nfra.io": "linux",
"csb7x2038.nfra.io": "linux",
"csb7x2038_docker": "linux",
"csi2010.nfra.io": "linux",
"semantic-search002-nsearch-jp3p-prod.lineinfra.com": "linux",
"keyword-extraction001-net-jp2p-prod.lineinfra.com": "linux",
"csi2010": "linux",
"csb7x2038": "linux"
},
"git.ignoreLegacyWarning": true,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all",
"terminal.integrated.inheritEnv": false,
"git.confirmSync": false,
"diffEditor.ignoreTrimWhitespace": false,
"gitlens.advanced.messages": {
"suppressGitVersionWarning": true
},
"sync.gist": "88e3d12fd9c1c2e454f8",
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "d"],
"after": ["d", "d"]
},
{
// re-do
"before": ["U"],
"after": ["<C-r>"]
},
{
"before": ["<C-n>"],
"commands": [":nohl"]
}
],
"vim.leader": "<space>",
"vim.handleKeys": {
"<C-a>": false,
"<C-d>": false, // vscode ctrl+d is multiple cursor selection. so, make vim dont use ctrl+d
//"<C-f>": false // in order to use vscode search box, uncomment this line
},
"python.languageServer": "Pylance",
"explorer.confirmDragAndDrop": false,
"todo-tree.tree.showScanModeButton": false
}
{
// 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"
// }
}
{
// Place your snippets for css 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"
// }
}
{
// Place your snippets for html 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"
// }
}
{
"initialize": {
"prefix": "init",
"description": "iniitialize",
"body": [
"#!/usr/bin/env python",
"# -*- coding: utf-8 -*-",
"import os, sys",
"def main():",
" ${1:main_code}",
"if __name__ == '__main__':",
" main()"
]
},
"option_parse": {
"prefix": "optparse",
"description": "",
"body": [
" import argparse",
" parser = argparse.ArgumentParser(description='${1:Process some integers.}')",
" parser.add_argument('${2:--foo}') # print args.foo",
" #parser.add_argument('-S', '--input-field', type=int, default=1)",
" #parser.add_argument('-e', '--empty', action='store_true')",
"",
" args = parser.parse_args(${3:sys.argv[1:]})",
"",
""
]
},
"multi_process": {
"prefix": "multi_process",
"description": "",
"body": [
"snippet multi_process",
"abbr multi_process snip",
"options word",
" # for multi process",
" import multiprocessing",
" from multiprocessing import Process, current_process",
"",
" import Queue",
" def ${1:__multiple_process_function}(queue):",
" current_process_name = current_process().name",
" while True:",
" try:",
" ${0: ...... } = queue.get(block=True,timeout=10)",
"",
" except Queue.Empty as empty_e:",
" sys.stderr.write(current_process_name+\" \"+\"Queue is empty - break!!\"+\"\\n\")",
" break",
"",
"",
" data_queue = multiprocessing.Queue() # for multiprocessing",
"",
" for ${3:__To_Be_Queued_item} in ${2:__To_Be_Queued_list}:",
" data_queue.put((${4: ........ }))",
"",
"",
" ### multi process block",
" processes = []",
" process_size = 6",
"",
" # append process",
" for i in range(process_size):",
" p=Process(target=${1:__multiple_process_function}, args=(data_queue,))",
" p.start()",
" processes.append(p)",
"",
" # join process",
" for p in processes:",
" p.join()",
" #",
" ### end of multi process block",
"",
"",
""
]
},
"colorama": {
"prefix": "colorama",
"description": "",
"body": [
"import colorama",
"from colorama import Fore, Back, Style",
"colorama.init()",
"",
"#print Fore.YELLOW, e, Style.RESET_ALL",
"",
"",
""
]
},
"mkdir": {
"prefix": "mkdir",
"description": "",
"body": [
"if not os.path.exists(${1:output_dir}): os.makedirs(${2:output_dir})"
]
},
"timestamp": {
"prefix": "timestamp",
"description": "",
"body": [
"import datetime",
"timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')",
"",
"",
""
]
},
"help_set": {
"prefix": "help_set",
"description": "",
"body": [
"s = set([1,2,3]) # s = {1,2,3}",
"",
"${1:#}s2 = set([3,4,5])",
"${2:#}intersection(s2) # intersections",
"",
"${3:#}s.union(s2) # union",
"${4:#}s.difference(s2) # difference",
"${5:#}s.add(4)",
"${6:#}s.update([4, 5, 6])",
"${7:#}s1.remove(2)",
"${0:}",
"",
"",
""
]
},
"multiprocess_map": {
"prefix": "multiprocess_map",
"description": "",
"body": [
"from multiprocessing import Pool",
"",
"",
"def ${1:__multiple_process_function}(input_args):",
" return_value = None",
" current_process_name = current_process().name",
"",
" return return_value",
"",
"",
"import multiprocessing",
"import logging",
"#",
"multiprocessing.log_to_stderr()",
"logger = multiprocessing.get_logger()",
"logger.setLevel(logging.INFO)",
"",
"process_size = 6",
"pool = Pool(process_size)",
"",
"input_list = []",
"for ${3:__To_Be_Queued_item} in ${2:__To_Be_Queued_list}:",
" input_list.append((${4: ........ }))",
"",
"r_list = pool.map( ${1:__multiple_process_function}, input_list)",
"",
"",
""
]
},
"log": {
"prefix": "log",
"description": "",
"body": [
"import logging",
"import logging.handlers",
"",
"LOG_DIR = os.environ.get('LOG_DIR',\".\")",
"",
"# 1. make logger instance",
"logger = logging.getLogger(${1:__file__})",
"# 2. make file and stream handler",
"#fileHandler = logging.FileHandler(__file__)",
"fileHandler = logging.handlers.RotatingFileHandler(os.path.join(LOG_DIR, os.path.basename(${2:__file__})+\".log\"), maxBytes=5*1024*1024, backupCount=2 )",
"streamHandler = logging.StreamHandler()",
"",
"# 3. appoint fomatter to handlers",
"fomatter = logging.Formatter('[%(filename)s:%(lineno)s] %(asctime)s > %(message)s')",
"fileHandler.setFormatter(fomatter)",
"streamHandler.setFormatter(fomatter)",
"",
"# 4. connect handlers to logger",
"logger.addHandler(fileHandler)",
"if type(streamHandler) not in [ type(handler) for handler in list(logger.handlers)]: logger.addHandler(streamHandler)",
"logger.setLevel(logging.DEBUG)",
"",
"# logger.info(\"${3:message}\")",
"${0:}",
"",
"",
"",
""
]
},
"class": {
"prefix": "class",
"description": "",
"body": [
"class ${1:#:name}(${2:object}):",
" def __init__(self, ${3}):",
" ${0:pass}",
"",
"",
"",
""
]
},
"with_open": {
"prefix": "with_open",
"description": "",
"body": [
"with open(${1:#:file}, '${2:r}') as ${3:f}:",
" ${0:pass}",
"",
"",
"",
""
]
},
"tryexcept": {
"prefix": "tryexcept",
"description": "",
"body": [
"try:",
" ${1:pass}",
"except ${2:#:ExceptionClass}:",
" ${3:pass}",
""
]
},
"sorted": {
"prefix": "sorted",
"description": "",
"body": [
"sorted(${1:input_list}, key=operator.itemgetter(1), reverse=True)",
"#sorted(input_list, key=lambda item: item[Tuple_Right_side][inner dict], reverse=True)",
"",
"",
""
]
}
}
{
"if": {
"prefix": "if",
"description": "if",
"body": [
"if ${0:condition} ",
"then",
"\t${1}",
"fi"
]
},
"find-exec": {
"prefix": "find-exec",
"body": [
"find . -name \"${1:}\" -exec ${2:COMMAND} \\{\\} \\;",
"${0:# ex) find . -name \"*.txt\" -exec cat \\{\\} \\; -exec echo \\{\\} \\;}"
],
"description": "if statement"
},
"bash": {
"prefix": "bash",
"body": "#!/bin/bash\n",
"description": "executer"
},
"echo": {
"prefix": "echo",
"body": "echo ${0:message}",
"description": "echo message"
},
"read": {
"prefix": "read",
"body": "read ${0:VAR}",
"description": "read input"
},
"elseif": {
"prefix": "elseif",
"body": "elif ${0:condition} \nthen\n\t${1}",
"description": "elseif"
},
"else": {
"prefix": "else",
"body": "else\n\t${0}",
"description": "else"
},
"test_string_empty": {
"prefix": "test_string_empty",
"body": "test -z $${0:VAR}",
"description": "test string empty"
},
"test_string_equal": {
"prefix": "test_string_equal",
"body": "test $${0:VAR1} = $${1:VAR2}",
"description": "test string equal"
},
"test_string_not_empty": {
"prefix": "test_string_not_empty",
"body": "test -n $${0:VAR}",
"description": "test string not empty"
},
"test_string_not_equal": {
"prefix": "test_string_not_equal",
"body": "test $${0:VAR1} != $${1:VAR2}",
"description": "test string not equal"
},
"test_int_equal": {
"prefix": "test_int_equal",
"body": "test $${0:VAR1} -eq $${1:VAR2}",
"description": "test int equal"
},
"test_int_great_equal": {
"prefix": "test_int_great_equal",
"body": "test $${0:VAR1} -ge $${1:VAR2}",
"description": "test int great equal"
},
"test_int_great_than": {
"prefix": "test_int_great_than",
"body": "test $${0:VAR1} -gt $${1:VAR2}",
"description": "test int great than"
},
"test_int_less_equal": {
"prefix": "test_int_less_equal",
"body": "test $${0:VAR1} -le $${1:VAR2}",
"description": "test int less equal"
},
"test_int_less_than": {
"prefix": "test_int_less_than",
"body": "test $${0:VAR1} -lt $${1:VAR2}",
"description": "test int less than"
},
"test_int_not_equal": {
"prefix": "test_int_not_equal",
"body": "test $${0:VAR1} -ne $${1:VAR2}",
"description": "test int not equal"
},
"test_exist": {
"prefix": "test_exist",
"body": "test -e $${0:VAR}",
"description": "test exist"
},
"test_exist_file": {
"prefix": "test_exist_file",
"body": "test -f $${0:VAR}",
"description": "test exist file"
},
"test_exist_directory": {
"prefix": "test_exist_directory",
"body": "test -d $${0:VAR}",
"description": "test exist directory"
},
"test_exist_readable": {
"prefix": "test_exist_readable",
"body": "test -r $${0:VAR}",
"description": "test exist readable"
},
"test_exist_writeable": {
"prefix": "test_exist_writeable",
"body": "test -w $${0:VAR}",
"description": "test exist writeable"
},
"test_exist_executable": {
"prefix": "test_exist_executable",
"body": "test -x $${0:VAR}",
"description": "test exist executable"
},
"test_exist_link": {
"prefix": "test_exist_link",
"body": "test -h $${0:VAR}",
"description": "test exist link"
},
"test_file_equal": {
"prefix": "test_file_equal",
"body": "test $${0:VAR} -ef $${1:VAR}",
"description": "test file equal"
},
"test_file_new_than": {
"prefix": "test_file_new_than",
"body": "test $${0:VAR} -nt $${1:VAR}",
"description": "test file new than"
},
"test_file_old_than": {
"prefix": "test_file_old_than",
"body": "test $${0:VAR} -ot $${1:VAR}",
"description": "test file old than"
},
"for_in": {
"prefix": "for_in",
"body": "for ${0:VAR} in $${1:LIST}\ndo\n\techo $${0:VAR}\ndone\n",
"description": "for loop in list"
},
"for_i": {
"prefix": "for_i",
"body": "for((${0:i}=0;${0:i}<${1:10};${0:i}++));\ndo\n\techo $${0:i}\ndone\n",
"description": "for loop by index"
},
"while": {
"prefix": "while",
"body": "while ${0:condition} \ndo\n\t${1}\ndone\n",
"description": "while loop by condition"
},
"until": {
"prefix": "until",
"body": "until ${0:condition} \ndo\n\t${1}\ndone\n",
"description": "until loop by condition"
},
"function": {
"prefix": "function",
"body": "function ${0:name}()\n{\n\t${1}\n}",
"description": "define a function"
},
"case": {
"prefix": "case",
"body": "case $${0:VAR} in\n\t${1:1}) echo 1\n\t;;\n\t${2:2|3}) echo 2 or 3\n\t;;\n\t*) echo default\n\t;;\nesac\n",
"description": "switch case"
},
"break": {
"prefix": "break",
"body": "break ${0}",
"description": "break loop or (n) loops"
},
"expr": {
"prefix": "expr",
"body": "expr ${0:1 + 1}",
"description": "calculate numbers"
},
"current_dir": {
"prefix": "current_dir",
"description": "get script file location anywhere source this file",
"body": [
"export ${1:PROJ_HOME}=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" > /dev/null && pwd)\"",
"",
""
]
},
"read_lines": {
"prefix": "read_lines",
"description": "",
"body": [
"while read -r line",
"do",
" name=\"$line\"",
" echo \"Name read from file - $name\" | awk -F$'\\t' '{{print $1}}'",
"done < ${1:1}",
"",
"",
""
]
},
"COMMENT": {
"prefix": "COMMENT",
"description": "",
"body": [
":<<COMMENT",
"",
"COMMENT",
"",
"",
""
]
},
"shebang": {
"prefix": "shebang",
"description": "",
"body": [
"# !/bin/${1:sh}",
"${0}",
"",
"",
""
]
},
"array_list": {
"prefix": "array_list",
"description": "",
"body": [
"## declare an array variable",
"#declare -a arr=(\"element1\" \"element2\" \"element3\")",
"#export arr=(\"element1\" \"element2\" \"element3\")",
"arr=(\"element1\" \"element2\" \"element3\")",
"",
"## now loop through the above array",
"for i in \"${arr[@]}\"",
"do",
" echo \"$i\"",
" # or do whatever with individual element of the array",
"done",
"",
"",
""
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment