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 03:30
promise, async await, .then
@jyydev
jyydev / vscode-default-keyboard-shortcuts.json
Last active July 6, 2021 04:16
VSCode > keyboard shortcuts, shortcut keys > default > json
[
{ "key": "escape escape", "command": "workbench.action.exitZenMode",
"when": "inZenMode" },
{ "key": "shift+escape", "command": "closeReferenceSearch",
"when": "inReferenceSearchEditor && !config.editor.stablePeek" },
{ "key": "escape", "command": "closeReferenceSearch",
"when": "inReferenceSearchEditor && !config.editor.stablePeek" },
{ "key": "escape", "command": "editor.closeTestPeek",
"when": "testing.isInPeek && !config.editor.stablePeek || testing.isPeekVisible && !config.editor.stablePeek" },
{ "key": "shift+escape", "command": "cancelSelection",
@jyydev
jyydev / fs read local json file.js
Last active June 28, 2021 14:10
fs read local json file
var fs = require('fs');
var folder = 'vs_code';
var file = 'keyboard_shortcuts';
var path = `${folder}/${file}.json`
var jsonFile = fs.readFileSync(path);
rs = JSON.parse(jsonFile);
console.log(rs);
<html>
<title>(BNB/BTC) Binance - Web Socket Stream</title>
<script language="javascript" type="text/javascript">
var wsUri = "wss://stream.binance.com:9443/ws/bnbbtc@depth5";
var outputDiv;
var output;
function init() {
outputDiv = document.getElementById("output");
@jyydev
jyydev / index.html
Created June 28, 2021 14:25
Parallax scroll animation
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 750 500" preserveAspectRatio="xMidYMax slice">
<defs>
<!-- Scene 1 Gradient -->
<linearGradient id="grad1" x1="-154.32" y1="263.27" x2="-154.32" y2="374.3"
gradientTransform="matrix(-1, 0, 0, 1.36, 231.36, -100.14)" gradientUnits="userSpaceOnUse">
<stop offset="0.07" stop-color="#9c536b" />
<stop offset="0.98" stop-color="#d98981" />
</linearGradient>
<radialGradient id="bg_grad" cx="375" cy="-35" r="318.69" gradientUnits="userSpaceOnUse">
<stop offset="0.1" stop-color="#F5C54E" id="sun" />
@jyydev
jyydev / README.md
Last active June 29, 2021 00:12
Chome DevTools keyboard shortcuts
@jyydev
jyydev / README.md
Last active June 29, 2021 02:06
fetch() catch error

Catch fetch() error

  • type: full code example
  • language: javascript
  • function: fetch()
  • demo: catch error

2 files

@jyydev
jyydev / README.md
Created June 29, 2021 02:54
.env file priority

.env file priority for environment variables

.env.development.local > .env.development > .env.local > .env

.env.production.local > .env.production > .env.local > .env

If the same variable exists, higher priotiy (on the left) will overwrite the value of the lower priority.

@jyydev
jyydev / README.md
Last active June 29, 2021 03:21
gist template readme

Catch fetch() error

  • type: full code example
  • language: javascript
  • function: fetch()
  • demo: catch error

2 files

@jyydev
jyydev / test.json
Last active June 29, 2021 05:55
description test1
[
{
"a":"a",
"b":"b"
},
{
"c":"c",
"d":"d"
}
]