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 June 29, 2021 05:16
github api urls

Github API urls

  • https://api.github.com/repos/<USERNAME>/contents/
  • https://api.github.com/repos/<USERNAME>/contents/<REPO>/<FOLDER/FILE...>

Raw

  • https://raw.githubusercontent.com/{USERNAME}/{FOLDER,FILE...}
@jyydev
jyydev / README.md
Last active June 29, 2021 06:27
demo gist api

Demo Gist API

  • Type: full code example
  • Language: javascript, node.js
  • Demo: update an existing gist:
    • create a new file in a gist
    • edit the content of a gist file

Requirements

  • Github personal access token
  • Run: npm i @octokit/core in terminal
@jyydev
jyydev / README.md
Last active June 29, 2021 07:56
VSCode open editors setting

VSCode open editors setting

Search in setting: explorer.openEditors.visible

Default

Explorer › Open Editors: Visible
@jyydev
jyydev / README.md
Last active April 16, 2025 21:21
VSCode -> autocomplete -> disable & turn off autocomplete on dot . period

Disable (turn off) autocomplete on dot . period for VSCode

Most people do not want to have autocompletion when they press the dot key, which should be disabled by default in VSCode.

Below shows 2 ways to turn this off.

Method 1:

  1. Go to VSCode setting and search for:
editor.acceptSuggestionOnCommitCharacter
@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:

@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 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 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 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 July 1, 2021 01:38
VSCode > default setting > customize