This file contains 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
Show hidden characters
[ | |
// Tabs - Reorder with "Shift + Left/Right" | |
{ | |
"key": "shift+left", | |
"command": "-cursorColumnSelectLeft", | |
"when": "editorColumnSelection && textInputFocus" | |
}, | |
{ | |
"key": "shift+left", | |
"command": "-cursorLeftSelect", |
This file contains 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
{ | |
"vim.leader": "<space>", | |
"vim.normalModeKeyBindings": [ | |
// Tabs | |
{ | |
"before": ["H"], // Focus previous tab at the left | |
"commands": ["workbench.action.previousEditor"] | |
}, | |
{ | |
"before": ["L"], // Focus next tab at the right |
This file contains 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
[ | |
{ | |
"key": "h", | |
"command": "editor.action.scrollLeftHover", | |
"when": "editorHoverFocused" | |
}, | |
{ | |
"key": "j", | |
"command": "editor.action.scrollDownHover", | |
"when": "editorHoverFocused" |
This file contains 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
{ | |
"vim.smartRelativeLine": true, | |
"editor.cursorSurroundingLines": 8, | |
"editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?", | |
"vim.leader": "<space>", | |
"vim.normalModeKeyBindings": [ | |
{ | |
"before": ["<leader>", "e"], | |
"commands": ["workbench.view.explorer"] | |
}, |
This file contains 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
# Run `python pipsize.py` in Terminal to show size of pip packages | |
# Credits: https://stackoverflow.com/a/67914559/11067496 | |
sort_in_descending = True # Show packages in descending order | |
import os | |
import pkg_resources | |
def calc_container(path): | |
total_size = 0 |
This file contains 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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"newline": true, | |
"segments": [ | |
{ | |
"foreground": "lightYellow", | |
"style": "plain", |
This file contains 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
/* Tweet: https://twitter.com/AnsonH_/status/1439546876718551049?s=20 */ | |
/* First photo */ | |
function myFunc(a, b, ...args) { | |
// Remaining arguments are stored in `args` array | |
console.log("a: ", a); | |
console.log("b: ", b); | |
console.log("args: ", args); // This is an array! | |
} |
This file contains 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
/* Tweet: https://twitter.com/AnsonH_/status/1437398568055181314?s=20 */ | |
/* Sleep function */ | |
async function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} | |
/* Example */ | |
async function takeNap() { |
This file contains 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
/* Tweet: https://twitter.com/AnsonH_/status/1436669886055415816?s=20 */ | |
function slowFunction() { | |
for (let i = 0; i < 999999999; ++i) { | |
// do something... | |
} | |
} | |
/***** Browser example *****/ |
This file contains 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
/* Tweet: https://twitter.com/AnsonH_/status/1435945599367479303 */ | |
class Student { | |
#gpa; // 1. Declare private property using the # sign | |
constructor(gpa) { | |
this.#gpa = gpa; // 2. Add this private property to class instance | |
} | |
// Private method |
NewerOlder