伪元素 | 作用 | 使用场景 | 示例 |
---|---|---|---|
::after |
在元素内容之后插入内容 | 添加装饰性内容,如图标、边框 | p::after { content: "★"; } |
::before |
在元素内容之前插入内容 | 添加装饰性内容,如图标、边框 | p::before { content: "★"; } |
::first-letter |
选择第一个字母 | 首字下沉,字体样式变化 | p::first-letter { font-size: 200%; } |
::first-line |
选择第一行文本 | 改变段落的第一行文本样式 | p::first-line { color: blue; } |
::selection |
定制用户选中文本的样式 | 更改选中文本的颜色和背景 | p::selection { color: white; background: black; } |
::placeholder |
定制输入字段的占位符文本样式 | 改变输入框占位符的样式 | input::placeholder { color: grey; } |
::marker |
定制列表项标记的样式 | 改变列表项目符号的样式 | li::marker { color: red; } |
This file contains 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
#!/usr/bin/env python3 | |
import os | |
import datetime | |
backup_folder = "/root/backup" | |
def read_file(file_path): | |
try: | |
with open(file_path, 'r') as file: |
This file contains 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 generateJSDoc(obj, prefix = '') { | |
const jsdocComment = (name, type) => { | |
return ` * @property {${type}} ${name}`; | |
}; | |
const walkObj = (childObj, childPrefix) => { | |
let jsdocStr = ''; | |
for (let key in childObj) { | |
if (!Object.prototype.hasOwnProperty.call(childObj, key)) { | |
continue; |
This file contains 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
#wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
#sh Miniconda3-latest-Linux-x86_64.sh | |
#source .bashrc | |
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/ | |
conda create -n sbweb python=3.10 | |
conda activate sbweb | |
apt install nvidia-cuda-toolkit | |
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git | |
cd stable-diffusion-webui/ | |
git clone https://github.com/camenduru/sd-civitai-browser ./extensions/sd-civitai-browser |
This file contains 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
/// https://developers.cloudflare.com/workers/ | |
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
// https://example.com/author/repo/name.podspec?xxx=xxx | |
const url = new URL(request.url) | |
const [, author, repo, name] = url.pathname.split(/[\./]/g) |
This file contains 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
func Go(f func()) { | |
go func() { | |
defer func() { | |
if err := recover(); err != nil { | |
fmt.Println("Recover:", err) | |
} | |
}() | |
f() | |
}() | |
} |
This file contains 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
package tryCatch | |
//https://www.cnblogs.com/beiluowuzheng/p/10263724.html | |
import ( | |
"reflect" | |
) | |
type CatchHandler interface { | |
Catch(e error, handler func(err error)) CatchHandler |
This file contains 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
// | |
// CenterAlignmentFlowLayout.swift | |
// Play | |
// | |
// Created by Tbxark on 15/12/28. | |
// Copyright © 2015年 TBXark. All rights reserved. | |
// | |
import UIKit |
This file contains 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
extension NSString { | |
func rangesOfSubString(_ string: String) -> [NSRange] { | |
var searchRange = NSMakeRange(0, length) | |
var searchResult = [NSRange]() | |
while searchRange.location < length { | |
searchRange.length = length - searchRange.location | |
let foundRange = range(of: string, options: [], range: searchRange) | |
if foundRange.location != NSNotFound { | |
searchResult.append(foundRange) | |
searchRange.location = foundRange.location+foundRange.length |