Skip to content

Instantly share code, notes, and snippets.

View jyydev's full-sized avatar
:octocat:
✌(≧◠ᴥ◠J)✌ + ✌(Y◠ᴥ◠≦)✌ = :octocat: :octocat:

JY jyydev

:octocat:
✌(≧◠ᴥ◠J)✌ + ✌(Y◠ᴥ◠≦)✌ = :octocat: :octocat:
View GitHub Profile
@jyydev
jyydev / README.md
Last active July 16, 2021 02:32
VSCode > links
@jyydev
jyydev / README.md
Last active July 16, 2021 02:07
React > jsx > object > .map()

How to iterate, loop through object in React, reactjs, jsx

const obj = { a: 'aa', b: 'bb' };

return {
  <div>
    {Object.entries(costss).map(([key, cost]) => {
      return (
 
@jyydev
jyydev / README.md
Last active July 16, 2021 01:44
javascript > links
@jyydev
jyydev / README.md
Last active July 1, 2021 01:38
VSCode > default setting > customize
@jyydev
jyydev / README.md
Last active June 30, 2021 13:16
Tutorial > YouTube > Coding Addict > javascript > reduce (object example)

Tutorial > YouTube > Coding Addict > javascript > reduce (object)

Demonstrate the use case of reduce() with github public api.

Files

Live preview

@jyydev
jyydev / README.md
Last active June 30, 2021 12:10
VSCode > shortcut keys > tabs, open editors > change to next, previous tab

VSCode > shortcut keys > tabs, open editors > change to next, previous tab

Quickly change to next tab and previous tab with keyboard shortcuts.

By default, VS Code cycle through tabs through ctrl+tab.

Solution

  1. Open command palette: cmd+shift+p
@jyydev
jyydev / README.md
Last active June 30, 2021 10:28
React > component > render twice on useState(), set

React > component > render twice on useState(), setValue()

Problem

React component render twice on useState().

const [value, setValue] = useState('');
@jyydev
jyydev / README.md
Last active June 30, 2021 10:26
VSCode -> autocomplete -> settings

VSCode > autocomplete > settings

Here are few settings to turn on and off the autocomplete when a certain key is pressed.

This is different from turning off the suggestions. Suggestion still appears but will not trigger autocomplete when a certain key is pressed.

Autocomplete settings:

How to turn on and off autocomplete when enter, return key is pressed:

@jyydev
jyydev / README.md
Last active June 29, 2021 11:26
VSCode -> autocomplete -> disable, turn off autocomplete on enter, return

Disable (turn off) autocomplete on enter, return key for VSCode

Some people do not want to autocomplete when they enter.

They will choose tab key instead since you have to press esc when you want to use enter key and at the same the unwanted suggestion shows up.

But some people find enter key is more handy instead.

Anyway, below shows 2 ways to turn this off.

Method 1: