macOs:
cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF
const urlPattern = "**/some_endpoint"; | |
const delayMS = 1000 | |
await page.route(urlPattern, async (route) => { | |
const resolve = (route: Route) => route.continue(); | |
const res = new Promise(() => resolve); | |
setTimeout(async () => { | |
await resolve(route); | |
}, delayMS); |
# Combined commands (See below for descriptions about what each one is doing): | |
yarn run build | awk '$0~/ERROR in/' | sed -e 's/ERROR in //' -e 's/:[0-9]:[0-9]//' -e 's/:[0-9][0-9]:[0-9]//' -e 's/:[0-9][0-9]:[0-9][0-9]//' > file_paths.txt | |
# yarn run build > build_output.txt # Direct stdout to a file. yarn run build runs `webpack` | |
# awk '$0~/ERROR in/' build_output.txt > files_with_errors.txt # Get the lines that start with the string "ERROR in" and print them to the file, files_with_errors.txt | |
# sed -e 's/ERROR in //' -e 's/:[0-9]:[0-9]//' -e 's/:[0-9][0-9]:[0-9]//' -e 's/:[0-9][0-9]:[0-9][0-9]//' files_with_errors.txt > paths_without_line_numbers.txt # Find and replace instances of "ERROR in " with nothing, run several matchers to remove trailing line and column numbers on the path strings that take like something like "/path/to/some/file.ts:10:11". |
const requireRegex = new RegExp(/(?:var|let|const)?\s*([^\s]+)?(\s*=\s*)?require\s*\(['"](.+)['"]\)[;,]?/, 'g'); | |
const importReplace = "import $1 from '$3';"; | |
const exportsRegex = new RegExp(/module.exports\s*=\s*/, 'g'); | |
const exportReplace = "export default "; | |
const importMissingVariable = new RegExp(/import\s*from\s*'/, 'g'); | |
const replaceMissingVariable = "import '"; |
{ | |
"keys": ["tab"], | |
"command": "expand_abbreviation_by_tab", | |
// put comma-separated syntax selectors for which | |
// you want to expandEmmet abbreviations into "operand" key | |
// instead of SCOPE_SELECTOR. | |
// Examples: source.js, text.html - source | |
"context": [ | |
{ |