Skip to content

Instantly share code, notes, and snippets.

View Linhieng's full-sized avatar
😋
Now the FrontEnd has really become my hobby! Because my job isn't about it😏

Alan Linhieng

😋
Now the FrontEnd has really become my hobby! Because my job isn't about it😏
View GitHub Profile
<# 负责打印 git 分支相关信息
支持输出以下信息:
当前分支,或者是 hash 值
当前目录是否为 git 子目录
当前是否有提交历史
#>
function write_host_git_branch {
# 在这里,能确保是一个 git 仓库,或者是一个 git 仓库中的子目录
@Linhieng
Linhieng / webkit滚动条可配置样式.html
Created November 2, 2023 13:23
丑,但很容易看出样式的效果
<body>
<main><div></div></main>
</body>
<style>
div {
width: 2000px;
height: 2000px;
background: linear-gradient(45deg, #e66465, #9198e5);
}
<body>
<main class="scroll-wrapper__not_edge"><div class="content"></div></main>
</body>
<style>
.scroll-wrapper__not_edge {
--scroll-transparent-bg: white;
--scroll-color: skyblue;
--scroll-background-side: 200px;
--scroll-thumb-side: 100px;
@Linhieng
Linhieng / Microsoft.PowerShell_profile.ps1
Last active August 26, 2023 06:28
PowerShell prompt string
function prompt {
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal] $identity
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
$fullpath = (Get-Location) -replace "\\", "/"
if($principal.IsInRole($adminRole)) {
([System.Environment]::NewLine) + "[Admin] " + "$([char]0x1b)[92m" + "$fullpath" + "$([char]0x1b)[91m" + ([System.Environment]::NewLine) + "> "
} else {
([System.Environment]::NewLine) + "$([char]0x1b)[92m" + "$fullpath" + "$([char]0x1b)[91m" + ([System.Environment]::NewLine) + "> "
@Linhieng
Linhieng / bili_pb2.py
Last active October 26, 2022 13:04
py 抓取b站弹幕并查看用户身份的小练习
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: my.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)