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
using System; | |
using System.Text.Json; | |
var foo = new { ... }; | |
string json = JsonSerializer.Serialize(foo, new JsonSerializerOptions { | |
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, // 中文字不編碼 | |
WriteIndented = true // 換行與縮排 | |
}); |
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
// Licensed to the .NET Foundation under one or more agreements. | |
// The .NET Foundation licenses this file to you under the MIT license. | |
using System.Globalization; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Text.Encodings.Web; | |
using System.Text.Json; | |
using Microsoft.AspNetCore.Authentication; | |
using Microsoft.AspNetCore.Authentication.Cookies; |
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
using System.Net; | |
using System.IO; | |
// Upload File to Specified FTP Url with username and password and Upload Directory | |
//if need to upload in sub folders /// | |
//Base FtpUrl of FTP Server | |
//Local Filename to Upload | |
//Username of FTP Server | |
//Password of FTP Server |
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 () { | |
'use strict'; | |
var body = document.body, | |
html = document.documentElement; | |
var docHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
var findingColor = 'limegreen'; | |
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
git init # 初始化本地git仓库(创建新仓库) | |
git config --global user.name "xxx" # 配置用户名 | |
git config --global user.email "[email protected]" # 配置邮件 | |
git config --global color.ui true # git status等命令自动着色 | |
git config --global color.status auto | |
git config --global color.diff auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
git config --global --unset http.proxy # remove proxy configuration on git | |
git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
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 useUpdateEffect(cb: () => void, depend: any[]) { | |
const [status, setStatus] = useState(false) | |
useEffect(() => { | |
if(status) { | |
cb() | |
} else { | |
setStatus(true) | |
} | |
}, depend) |
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 createNode(path, tree) { | |
const name = path.shift(); | |
const idx = tree.findIndex((e) => { | |
return e.name === name; | |
}); | |
if (idx < 0) { | |
tree.push({ | |
name: name, | |
children: [], | |
leaf: path.length === 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
import React from "react"; | |
import { css, cx } from "emotion"; | |
import InputLabel from "@material-ui/core/InputLabel"; | |
import MenuItem from "@material-ui/core/MenuItem"; | |
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles"; | |
import FormControl from "@material-ui/core/FormControl"; | |
import Select from "@material-ui/core/Select"; | |
const theme = createMuiTheme({ | |
overrides: { | |
// Style sheet name ⚛️ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- The jQuery library is a prerequisite for all jqSuite products --> | |
<script | |
type="text/ecmascript" | |
src="http://code.jquery.com/jquery-2.1.1.min.js" | |
></script> | |
<!-- We support more than 40 localizations --> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | |
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> |
NewerOlder