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
| let dict = Array.from(new URLSearchParams(window.location.search)).reduce( | |
| (d, [k, v]) => { | |
| d[k] = v; | |
| return d; | |
| }, | |
| {} | |
| ); |
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
| yarn init | |
| yarn -D typescript tslib @rollup/plugin-typescript | |
| mkdir src |
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
| const fs = require('fs') | |
| const rawdata = fs.readFileSync('./path/to/file_with.anyext', 'utf8') | |
| eval(rawdata) |
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
| # find DisplayName related to 'alias' | |
| Find-Alias alias |
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
| Get-File-Lines ./my.log |
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
| const readline = require("readline"); | |
| const fs = require("fs"); | |
| const input = fs.createReadStream("my.log", { | |
| encoding: "utf-8", | |
| }); | |
| const rl = readline.createInterface(input); | |
| rl.on("line", (line) => { |
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
| function Wait-Test { | |
| $a = Start-Job -ScriptBlock { ping 8.8.8.8 } | |
| $b = Start-Job -ScriptBlock { echo "test" } | |
| Wait-Job $a,$b | |
| echo "done" | |
| } |
- https://github.com/richardgirges/express-fileupload/tree/master/example
- https://www.pluralsight.com/guides/uploading-files-with-reactjs
- https://zh-hant.reactjs.org/docs/uncontrolled-components.html#the-file-input-tag
上傳有可能會遇到 413 的錯誤, 表示 server 端有環節需要調整限制的地方(express, nginx ...etc)
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
| fetch('http://localhost:8888/test', { | |
| method: 'POST', | |
| body: JSON.stringify({ name: 'NaCl' }), | |
| headers: { | |
| 'content-type': 'application/json' | |
| } | |
| }) |
OlderNewer