Skip to content

Instantly share code, notes, and snippets.

View CN-CODEGOD's full-sized avatar
😏
share my thought

CN-CODEGOD

😏
share my thought
View GitHub Profile
@CN-CODEGOD
CN-CODEGOD / gist:ec1b21c5647c16852462f99d47dc0a42
Created January 9, 2025 11:06
利用模组Windows terminal 命令行导入文件profile等
模组写入:
foreach ($file in Get-ChildItem "Public"|Where-Object{$_.Name -like "*.ps1"}) {
. $file.FullName
}
写入windows terminal命令行:
c:\Program Files\PowerShell\7-preview\pwsh.exe -noprofile -noexit /c import-module "C:\Users\Adminnistrator\demo\shell\wt\ezshell\ezshell.psm1"
复制的时候在开始菜单创建Public文件夹,并在public文件夹中写入要导入的文件
@CN-CODEGOD
CN-CODEGOD / gist:85f017260b0e293c94a57c3a86abb8dc
Created January 6, 2025 07:37
设置globalsummon quake MODE
{
"id": "User.MySummonQuake",
"command": {
"action": "globalSummon",
"name": "_quake",
"dropdownDuration": 200,
"toggleVisibility": true,
"monitor": "toMouse",
"desktop": "toCurrent"
}
@CN-CODEGOD
CN-CODEGOD / gist:46b148f2443b71a83568a9b211ba97d7
Created January 6, 2025 02:22
如何用powershell获取iterm2的theme json 直接复制粘贴
# 定义目标路径
$directoryPath = "C:\path\to\your\json\files"
# 获取该路径下所有的 JSON 文件
$jsonFiles = Get-ChildItem -Path $directoryPath -Filter "*.json"
# 初始化一个空数组来存储所有 JSON 对象
$jsonArray = @()
# 遍历每个 JSON 文件
@CN-CODEGOD
CN-CODEGOD / gist:392f6c97383d144877784a027f48d841
Created January 5, 2025 14:40
how to open shell with wt keybinding
First :adding action blocks
{
"command":
{
"action":"openNewTabDropdown",
},
"id":"user.mynewtabdropdown"
}
@CN-CODEGOD
CN-CODEGOD / gist:cec236fd6114c49022c5f176e2bb0ac2
Created January 5, 2025 11:43
html 常用modules 导入方法
description:
因为常常写html,需要导入bootstrap,tailwind,所以写一个gist总结方法
#jQuery,cdn
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
#
bootstap ,cdn
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
#tailwind
@CN-CODEGOD
CN-CODEGOD / gist:a231503b9e07e78b390b6b8bd361fa8d
Created January 3, 2025 17:57
Powershell adding key function with psreadline
$parameters = @{
# setting key for psreadline
Chord = if ($args.Count -eq 0 -or $null -eq $args[0]["Key"]) { "F7" } else { $args[0]["Key"] }
BriefDescription = 'Show Matching Command History'
Description = 'Show Matching Command History using Out-ConsoleGridView'
#setting scriptblock for psreadline
ScriptBlock = {
$params = @{ Global = $false }
if ($F7Diagnostic) { $params["Diagnostic"] = $true }
if ($F7UseNetDriver) { $params["UseNetDriver"] = $true }
@CN-CODEGOD
CN-CODEGOD / gist:5be19815ec81c81b48035af2cfb22337
Created December 30, 2024 17:08
powershell open filedialog
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') }
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
#选择路径
InitialDirectory = [Environment]::GetFolderPath('Desktop')
#filter 后缀
Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
}
$Null = $FileBrowser.ShowDialog()
列出images
docker images
开启images
docker compose up -d
列出运行的docker
docker ps
打开logs
docker compose logs -f
@CN-CODEGOD
CN-CODEGOD / gist:635b5fafd61d3815b8927d94d1672974
Created December 30, 2024 07:35
修改本地注册表单修改右键菜单
1.添加项在路径下下
2.在项下添加icon字符串
3.在项下新建command项
4.在command项下的默认字符串添加命令
文件右键菜单:
HKEY_CLASSES_ROOT\*\shell\
文件夹右键菜单:
HKEY_CLASSES_ROOT\Directory\shell\
@CN-CODEGOD
CN-CODEGOD / gist:6fdd5db67953597d01a67691b4abb795
Created December 29, 2024 19:49
解决pwsh 无法使用Add-appxpackage 问题
# NOTE: If you are using PowerShell 7+, please run
# Import-Module Appx -UseWindowsPowerShell
# before using Add-AppxPackage.