Skip to content

Instantly share code, notes, and snippets.

View mcwindy's full-sized avatar
🏠
Working from home

mcwindy

🏠
Working from home
View GitHub Profile
@mcwindy
mcwindy / windows_cpp_path_fix.md
Last active July 8, 2025 02:43
Fix msvc & windows sdk environment variable in windows

This script is used to update MSVC and Windows SDK environment variables on Windows systems, simplifying the C++ configuration of Visual Studio Code.

It performs the following tasks:

  1. Check for Administrator Privileges: The script first checks if it is running with administrator privileges. If not, it prompts the user to run the script as an administrator and exits.

  2. Get Latest Version Path: It scans the specified base paths to find the latest version of MSVC and Windows SDK installations.

  3. Update Environment Variables:

@mcwindy
mcwindy / mc_backup.sh
Last active August 29, 2023 02:23
script for backing up minecraft save
#!/bin/bash
diff=30001 # save for 3 days
uuid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Now=$(date "+%Y%m%d%H%M")
tar -zcvf ~/mcbackup/backups/$Now-$uuid.tar.gz --exclude=$uuid/plugins/dynmap -C/opt/mcsmanager/daemon/data/InstanceData/ $uuid/
for FILE in `ls ~/mcbackup/backups`
do
# filename=${FILE%%.*}
# pip install pyperclip
import pyperclip
while True:
txt = pyperclip.waitForNewPaste()
modified = txt.replace(',', ',')
modified = modified.replace('1', '2')
if txt != modified:
pyperclip.copy(modified)
# pyperclip.paste()
@mcwindy
mcwindy / svg.md
Last active April 27, 2023 01:50
Common svgs used to indicate severity in markdown.

Tip

<svg viewBox="0 0 24 24" width="24" height="24" style="stroke: #94D093; stroke-width: 1.6;"><ellipse cx="12" cy="12" rx="10.2" ry="10.2" fill-opacity="0"></ellipse><path d="M7.2 12L 10.2 15.6 L16.8 8.4"></path></svg>

Note

<svg viewBox="0 0 24 24" width="24" height="24" style="stroke: #ADD4FF; stroke-width: 1.6;"><ellipse fill="#ADD4FF" cx="12" cy="7.5" rx="0.5" ry="0.5"></ellipse><path d="M10.6 11.2 L12.2 11.2 L12.2 16.3 L10.2 16.3 L14.2 16.3"></path><ellipse fill-opacity="0" cx="12" cy="12" rx="10.2" ry="10.2"></ellipse></svg>
@mcwindy
mcwindy / logid.cfg
Last active April 30, 2024 07:59
logiop config
# sudo apt install -y cmake libevdev-dev libudev-dev libconfig++-dev
# git clone https://github.com/PixlOne/logiops
# cd logiops
# mkdir build && cd build
# cmake ..
# make -j$(nproc)
# sudo make install
# sudo touch /etc/logid.cfg
# sudo systemctl enable --now logid
Import-Module oh-my-posh
Import-Module posh-git
Set-PoshPrompt mine
chcp 936
Set-Alias -Name code -Value code-insiders.cmd
C:\Users\mcwindy\login.ps1
# Chocolatey profile
@mcwindy
mcwindy / .zshrc
Last active May 6, 2024 01:26
My zshrc config
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# NOTE when git clone, `git config --global core.autocrlf false` should be set
alias zshconfig="nano ~/.zshrc"
alias ohmyzsh="cd ~/.oh-my-zsh"
@mcwindy
mcwindy / robbyrussell.zsh-theme
Last active April 12, 2024 01:29
my zsh theme robbyrussell
# modded from ~/.oh-my-zsh/themes/robbyrussell.zsh-theme
# store in ~/.oh-my-zsh/custom/themes/mytheme.zsh-theme
# then run `_omz::theme::use mytheme`
PROMPT="%(?:%{$fg_bold[green]%}%1{➜%} :%{$fg_bold[red]%}%1{➜%} )"
PROMPT+=" %{$fg[magenta]%}%n%{$reset_color%}" # User
#PROMPT+="%{$fg[cyan]%}%c%{$reset_color%}" # Current folder name
PROMPT+="@%{$fg[cyan]%}%~%{$reset_color%}" # Directory
[ "$(git_prompt_info)" != "" ] && PROMPT+=" " # add white space if git prompt is not empty
PROMPT+="$(git_prompt_info) "
@mcwindy
mcwindy / settings.json
Last active April 18, 2023 01:23
windows terminal settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
@mcwindy
mcwindy / nj68.prf
Last active December 14, 2022 01:51
My keydous nj68 settings
<?xml version="1.0" encoding="UTF-8"?>
<Keydous68>
<PredefinedCombo>
<List SizeOfView="5" ViewStartAt="0" CursorPos="0" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0">
<x ID="0" t1="组合键1">
<List SizeOfView="5" ViewStartAt="0" CursorPos="1" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0">
<x ID="0" t1="Left CONTROL">
<List SizeOfView="5" ViewStartAt="0" CursorPos="0" Cycles="1" IsAutoInterval="0" Delay="30" PlayMode="0"/>
</x>
<x ID="1" t1="SPACEBAR">