Skip to content

Instantly share code, notes, and snippets.

View newpost's full-sized avatar
🎯
Focusing

hiboy newpost

🎯
Focusing
  • xi'an
  • 01:18 (UTC +08:00)
View GitHub Profile
@newpost
newpost / JsonSerializer.cs
Created July 5, 2024 02:41 — forked from relyky/JsonSerializer.cs
JsonSerializer, .NET5, json, 中文字不編碼, 換行與縮排, System.Text.Json, Indent
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 // 換行與縮排
});
@newpost
newpost / FtpTransfer.cs
Created October 18, 2022 07:43 — forked from sir4ju1/FtpTransfer.cs
Upload and Download file through FTP in C#
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
@newpost
newpost / case-sensitive-seach.js
Created October 19, 2021 09:03 — forked from borisdiakur/case-sensitive-seach.js
Bookmarklet for case-sensitive search in Google Chrome (and other browsers which do not ship this feature). You can find install instruction below the code.
(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';
@newpost
newpost / git_toturial
Created August 4, 2021 02:50 — forked from guweigang/git_toturial
git命令大全
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远程仓库