> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [blog.csdn.net](https://blog.csdn.net/yifen4234/article/details/80691434)
>
> 作者:Solomon1588
> 原文链接: [https://blog.csdn.net/Solomon1558/article/details/51763751](https://blog.csdn.net/Solomon1558/article/details/51763751)
>
> Shell 变量有局部变量、环境变量之分。局部变量就是指在某个 Shell 中生效的变量,只在此次登录中有效。环境变量通常又称 “全局变量”,虽然在 Shell 中变量默认就是全局的,但是为了让子 Shall 继承当前 Shell 的变量,需要使用 export 内建命令将其导出为环境变量。
## 一、Linux 的变量种类
按变量的生存周期划分:
* 永久的:需要修改配置文件,变量永久生效
> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [cloud.tencent.com](https://cloud.tencent.com/developer/article/2129796)
### 0x00 前言简述
Q: 操作系统的全局代理?
> 答:我们常常听说网络代理例如 Socket、Http 代理,全局代理即系统所有的流量都是通过该代理通道进行通信, 然而这个还不能说是全称走代理,只能说是 90% 的应用都可以使用这个设置来实现代理访问,但这个只是针对于个别软件由于他们更不都不走 http 协议,所有代理的方式不是绝对的,只有网关流量代理是完全代理的;
Q: 网上关于 Linux 中 http_proxy 的设置说明错误
> 答: Linux 操作系统全局代理配置主要在于环境变量的设置 http_proxy 该变量是支持 http 以及 socket 的; 比如 curl、git 软件默认使用 http_proxy 这个环境变量来设置代理[服务器](https://clou
HEADER AREA:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/monokai.min.css" />
CONTENT AREA:
<!-- POST CONTENT -->
<div wire:ignore>
<div id="editor" style="height: 500px; width: 100%;"></div>
</div>
<!-- Hidden textarea to bind with Livewire -->
<textarea id="content" name="content" style="display:none;" wire:model="post_content"></
function my_acf_save_post( $post_id ) {
// get new value
$user_id = get_field('lead_designer');
if($user_id){
wp_update_post( array( 'ID'=>$post_id, 'post_author'=>$user_id) );
}
}
add_action('acf/save_post', 'my_acf_save_post', 20);
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {TreeNode}
*/
var reverseOddLevels = function(root) {
if (!root) return null;
// Helper function to perform a BFS traversal and reverse node value at odd levels
const bfs = (root) => {
const q
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {TreeNode}
*/
var reverseOddLevels = function(root) {
if (!root) return null;
// Helper function to perform a BFS traversal and reverse node value at odd levels
const bfs = (root) => {
const q
# WSL 配置
- ## wsl 如何设置 Linux 子系统默认用户为 root
解决:
1. `WIN` + `R`,输入`cmd`打开命令行窗口
2. 输入命令: `cd %HOMEPATH%\AppData\Local\Microsoft\WindowsApps`,查看安装的子系统对应的应用名,比如:`ubuntu2404.exe`
3. 输入命令:`.\ubuntu2404.exe config --default-user root`
4. 再次打开子系统会发现已经默认登录用户为root了
- ## wsl 如何设置 Linux 子系统默认用户为 root
解决:
1. 输入命令:`wsl -l --all`查看所有版本
2. 命令格式:`wsl --setdefault wsl名称`,例如:`wsl --setdefault Ubuntu-24.04`将Ubuntu-24.04设置为默认子系统
.visuallyHidden {
position: absolute !important;
width: 1px !important;
height: 1px !important;
margin: -1px !important;
padding: 0 !important;
overflow: hidden !important;
clip: rect(0 0 0 0) !important;
white-space: nowrap !important;
border: 0 !important;
}
const fs = require('fs')
const data = fs.readFileSync('./networks.json').toString();
const sourceData = JSON.parse(data);
const networks = fs.readFileSync('./networks-list.json').toString();
const sourceNetworks = JSON.parse(networks);
const networksMapping = Object.fromEntries(sourceNetworks.map(({ wallet, network }) => [wallet, network]))
const normalized = sourceData.map((item) => ({
...item,
asset_identifier: item.asset_identifier || item.symbol,
network: item.network || net
observer.observe(document.body, {
attributes: true,
attributeFilter: ['class'],
});
});
document.addEventListener('DOMContentLoaded', () => {
const counters = document.querySelectorAll('.counter .el-title');
const startCounter = (counter) => {
// Set the data-target attribute based on the current content
const targetValue = counter.innerText.trim().replace(/[,\.]/g, '');
counter.setAttribute('data-target', targetValue);
// Set the initial value to 0
PJxrGPMK5ZTF
<template>
<div ref="div1">useTemplateRefの場合</div>
<div ref="div2">refの場合</div>
</template>
<script setup>
const div1 = useTemplateRef<HTMLDivElement>('div1')
const div2 = ref<HTMLDivElement | null>(null)
</script>
```tsx
import Button, { ButtonProps } from '@mui/material/Button';
import NextLink from 'next/link';
import { LoadingButton } from '@mui/lab'
```
```
LinkComponent={NextLink}
```
<!-- 使用例 -->
<section class="js-labelledby-uuid">
<h2 class="js-labelledby-uuid__heading">見出しです</h2>
<p>テキストです</p>
</section>
const ctaSettings = {
classes: {
animate: 'animate',
arrow: '.icon--arrow-cta'
},
animation: {
duration: 600,
interval: 5000
}
}
let ctaLastTime = 0;
// Function to trigger the animation
const ctaAnimationTrigger = () => {
const ctaArrows = document.querySelectorAll(ctaSettings.classes.arrow);
ctaArrows.forEach(arrow => arrow.classList.add(ctaSettings.classes.animate));
requestAnimationFrame(() => {
setTimeout(() => {
ctaArrows.forEach(arrow => arrow.c
/**
* @param {number[]} arr
* @return {number}
*/
var maxChunksToSorted = function(arr) {
// Variable to keep track of the number of chunks
let maxChunks = 0;
// Variable to keep track of the maximum value in the current chuck
let currentMax = 0;
// Loop through each element in the array
for (let i = 0; i < arr.length; i++) {
// Update the current maximum value in the chuck
currentMax = Math.max(currentMax, arr[i]);
// If the current maximum