Skip to content

Instantly share code, notes, and snippets.

View newpost's full-sized avatar
🎯
Focusing

hiboy newpost

🎯
Focusing
  • xi'an
  • 15:21 (UTC +08:00)
View GitHub Profile
@newpost
newpost / TwinCAT-PLC知识手册.md
Created September 6, 2026 14:56
TwinCAT PLC 知识手册

TwinCAT PLC 知识手册

面向 .NET 开发者与自动化工程师的 TwinCAT 3 入门到进阶知识手册。 本手册为纯知识/概念讲解,不包含代码示例,侧重概念、原理与工程实践的理解。


目录

@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 / keycloak-demo.cs
Created May 24, 2024 09:26
keycloak 例子
// 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;
@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 "xxx@xxx.com" # 配置邮件
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://git@192.168.53.168/VT.git # clone远程仓库
function useUpdateEffect(cb: () => void, depend: any[]) {
const [status, setStatus] = useState(false)
useEffect(() => {
if(status) {
cb()
} else {
setStatus(true)
}
}, depend)
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,
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 ⚛️
@newpost
newpost / jqgrid-with-search
Created June 9, 2020 03:30
jqgrid-with-search