Skip to content

Instantly share code, notes, and snippets.

View ccwanggl's full-sized avatar
🎯
Focusing

Guoliang WANG ccwanggl

🎯
Focusing
  • changli nano bioTech
  • changchun
View GitHub Profile
@ccwanggl
ccwanggl / Simulation.cs
Created June 16, 2024 05:22 — forked from DrustZ/Simulation.cs
Simulate keyboard and mouse input in WPF (similar to sendkeys in winform)
using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Windows.Input;
namespace Demo
@ccwanggl
ccwanggl / git-submodules.md
Created July 7, 2023 02:28 — forked from slavafomin/git-submodules.md
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive [email protected]:name/repo.git

— Initialize submodules after regular cloning:

@ccwanggl
ccwanggl / powershell.ps1
Created September 16, 2022 14:28
random posh setting
$theme = Get-ChildItem $env:UserProfile\\AppData\\Local\\Programs\\oh-my-posh\\themes\\ | Get-Random
echo "hello! today's lucky theme is: $theme :)"
oh-my-posh --init --shell pwsh --config $theme.FullName | Invoke-Expression
@ccwanggl
ccwanggl / .gitattributes
Created August 16, 2022 17:11 — forked from Mehver/.gitattributes
这个文档可以使GitHub正确的识别Altium Designer、KiCAD、Gerber以及Eagle的文档,并将它们加入到GitHub Repository的语言统计中。| This document allows GitHub to correctly identify Altium Designer, KiCAD, Gerber and Eagle documents and add them to GitHub Repository's language statistics.
# author: GitHub@TitanRGB
# This document allows GitHub to correctly identify Altium Designer, KiCAD, Gerber and Eagle documents and add them to GitHub Repository's language statistics.
# 这个文档可以使GitHub正确的识别Altium Designer、KiCAD、Gerber以及Eagle的文档,并将它们加入到GitHub Repository的语言统计中。
# https://gist.github.com/TitanRGB/61c37bf71159cc9a511558ec7c218339
*.OutJob linguist-detectable=true
*.PcbDoc linguist-detectable=true
*.PrjPCB linguist-detectable=true
*.SchDoc linguist-detectable=true
// Logiops (Linux driver) configuration for Logitech MX Master 3.
// Includes gestures, smartshift, DPI.
// Tested on logid v0.2.3 - GNOME 3.38.4 on Zorin OS 16 Pro
// What's working:
// 1. Window snapping using Gesture button (Thumb)
// 2. Forward Back Buttons
// 3. Top button (Ratchet-Free wheel)
// What's not working:
// 1. Thumb scroll (H-scroll)
// 2. Scroll button
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Import-Module -Name Terminal-Icons
@ccwanggl
ccwanggl / ohmyposhv3-v2.json
Created October 18, 2021 01:54 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@ccwanggl
ccwanggl / delete_git_submodule.md
Last active October 4, 2021 04:46 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ccwanggl
ccwanggl / smart-caps-lock.md
Created September 29, 2021 14:47 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.