Skip to content

Instantly share code, notes, and snippets.

View cychen2021's full-sized avatar

Chuyang Chen cychen2021

View GitHub Profile
@cychen2021
cychen2021 / export_dsc.nu
Created July 23, 2025 21:57
export_dsc.nu
# --- Nushell Script: Export DSC configuration from winget ---
def main [
--output (-o): string
] {
let timestamp = date now | format date '%Y-%m-%dT%H-%M-%S'
let output_file = if $output == null { $"($timestamp).ps1" } else { $output }
# Define a list of common system components or runtimes we don't want in the configuration.
@cychen2021
cychen2021 / takuya-indicator.omp.toml
Last active September 24, 2025 23:15
My oh-my-posh theme
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"
version = 3
[[blocks]]
alignment = "left"
type = "prompt"
[[blocks.segments]]
background = "#0077c2"
foreground = "#ffffff"
@cychen2021
cychen2021 / bookmark_for_dir.nu
Last active April 20, 2025 15:52
bookmark_for_dir.nu
#!/usr/bin/env nu
let bookmark_file_dir = $"($env.HOME)/.config/bookmark_for_dir"
let bookmark_file = $"($bookmark_file_dir)/bookmark.json"
# Show environment variables used
def "bm env" [] {
echo {
"bookmark_file_dir": $bookmark_file_dir
"bookmark_file": $bookmark_file
@cychen2021
cychen2021 / Install_Electron_over_GFW.md
Last active June 27, 2023 04:35
Electron在中国大陆因网络问题无法安装的解决办法

最近尝试用Electron写App,用npm安装electron依赖的时候卡了很久,很自然想到是网络问题,没想到npm设置了代理还是下不下来。

折腾了半天终于解决了,所以把自己最后发现的方法发到网上,供后来人参考。

简而言之,electron的安装脚本是自己下载相关文件的,不通过npm,所以要单独为安装脚本设置代理。给electron设置代理的方法参见Advanced Installation Instruction。另外,新版文档中给出的设置环境变量的教程链接不知道为什么有问题(是两个指向自身的链接),正确链接是Node 10 and aboveBefore Node 10