Remember this as a mantra: "Escape, Colon, Doublewww, Queue", Esc
+ :
+ w
+ q
img.src = document.getElementById('canvas').toDataURL();
// src will look like data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNb...
canvas.toDataURL('image/jpeg', 1.0); // full
canvas.toDataURL('image/jpeg', 0.5); // medium
canvas.toDataURL('image/jpeg', 0.1); // low
Table:
Purpose | Command | Remark |
---|---|---|
Move line up/down | Alt + Up Arrow/Down Arrow |
If you're from a sublime background like me, this is the equivalent for ctrl + shift in Sublime. |
Jump to matching bracket | Ctrl+Shift+\ | Chrome's ctrl + m equivalent or Sublime's ctrl + <bracket> |
Indent/outdent line | Ctrl + ] or [ |
-- |
Duplicate line | Going to the end of the line and then doing Ctrl + C followed by Ctrl + V |
This is Sublime or Atom's Ctrl + D equivalent |
All possibilities
new RegExp('word')).test(str) // ES2
str.indexOf('word') !== -1 // ES2
str.includes('word') // ES6
str.match(/word/gi)?.length > 0 //ES2019
MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
- Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
0.1.0
This file contains hidden or 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
{ | |
"always_show_minimap_viewport": true, | |
"block_caret": true, | |
"color_scheme": "Packages/Color Scheme - Default/Mariana.sublime-color-scheme", | |
"detect_indentation": true, | |
"draw_white_space": "all", | |
"font_size": 11, | |
"hot_exit": true, | |
"ignored_packages": ["Vintage"], | |
"theme": "Default.sublime-theme", |
Set Upstream branch for a git branch
git branch --set-upstream-to=origin/feat-foobar
-
Prettify all JavaScript files:
npx prettier --write "./src/**/*.js"
-
Check if your files are formatted: `npx prettier --check "src/**/*.js"
-
Simple commands:
npx eslint --fix
-
Somewhat complicated command:
npx eslint --fix --ext .js,.jsx .
Add these to the root package.json.
- While developing an expressjs app using ejs templating engine you may want to use keep the extension as
*.html
instead of*.ejs
- e.g.
home.html
instead of using home.ejs. - Main reason for using html is generally to use more effective code hint, formatting and syntax highlighting without adding any extra settings. To accomplish it, you can perform any of the following: