Skip to content

Instantly share code, notes, and snippets.

View pedoc's full-sized avatar
💭
I may be slow to respond.

pedoc pedoc

💭
I may be slow to respond.
View GitHub Profile
tools:
- name: Git-LFS Version
fileStarter: {command: '${git}', parameters: lfs --version}
useForOpen: false
waitUntilFinished: true
filePattern: '*'
- name: Open File
fileStarter: {command: rundll32.exe, parameters: 'URL.DLL,FileProtocolHandler ${filePath}'}
useForOpen: true
waitUntilFinished: false
// ==UserScript==
// @name GitHub Stars:隐藏我已 Star 的仓库
// @namespace https://github.com/
// @version 1.3
// @description 在 stars 页面(/stars/* 或 ?tab=stars)自动隐藏你已经 Star 的仓库,支持懒加载。
// @author You
// @include /^https:\/\/github\.com\/(?:stars\/[^\/?#]+|[^\/?#]+(?:\?.*?\btab=stars\b).*)$/
// @run-at document-idle
// @grant none
// ==/UserScript==
@pedoc
pedoc / performance_monitor.ps1
Last active August 10, 2025 08:31
performance monitor in windows
param(
[string]$ReportFile = "$(Join-Path $PSScriptRoot 'report.txt')"
)
Clear-Host
$ErrorActionPreference = "Stop"
try {
Start-Transcript -Path $ReportFile
@pedoc
pedoc / Open in Visual Studio.yml
Last active July 8, 2025 05:08
[SmartGit]Open in Visual Studio tool
tools:
- name: Open in Visual Studio
fileStarter: {command: 'C:\Program Files\PowerShell\7\pwsh.exe', parameters: '"C:\Users\pedoc\.scripts\openVS.ps1"
"${repositoryRootPath}"'}
useForOpen: false
waitUntilFinished: false
filePattern: '*'
# Use opendef https://github.com/pedoc/minitools/releases/tag/v1.0.0.0, fast
tools:
@pedoc
pedoc / install-vscode-server.sh
Last active June 2, 2025 03:48
install-vscode-server
#!/bin/bash
set -e
VER=${1:""}
if [ -z "$VER" ]; then
# shellcheck disable=SC2012
readarray -t versions < <(ls vscode-server_*_*.tar.gz 2>/dev/null | \
sed -n 's/^vscode-server_\([^_]*\)_[^_]*\.tar\.gz$/\1/p' | \
@pedoc
pedoc / install-zsh.sh
Last active April 23, 2025 05:19
Automatically install and configure zsh with one key
#!/bin/bash
set -e
PROXY="http://192.168.1.2:10808"
export https_proxy=$PROXY
export http_proxy=$PROXY
ARCH=$(uname -m)
case "$ARCH" in
@pedoc
pedoc / main.cs
Created September 24, 2024 07:57
UrlEncode eq php and java
using System;
using System.Net;
using System.Text;
public class Program
{
public static void Main()
{
Console.WriteLine(PhpLikeUrlHelper.UrlEncode("Hello World! 你好 #$&\'()*+,-./:;=?@[]!\'", Encoding.UTF8));
}
@pedoc
pedoc / simulate keyboard input
Created September 20, 2018 12:46
simulate keyboard input
public class Keyboard
{
public void Send(ScanCodeShort a)
{
INPUT[] Inputs = new INPUT[1];
INPUT Input = new INPUT();
Input.type = 1; // 1 = Keyboard Input
Input.U.ki.wScan = a;
Input.U.ki.dwFlags = KEYEVENTF.SCANCODE;
Inputs[0] = Input;
@pedoc
pedoc / tools.yml
Last active May 21, 2022 04:35 — forked from kohenkatz/tools.yml
Opening Windows Terminal and VSCode from SmartGit
# Add these entries to your `tools.yml` to be able to right-click to open
# things in VSCode (files and folders) and Windows Terminal (folders only) and Visual Studio(sln files).
# Make sure to change `YOUR_USERNAME` in the VSCode path.
tools:
- name: Open in VSCode
fileStarter: {command: 'C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe',
parameters: '"${filePath}"'}
useForOpen: true
waitUntilFinished: false
@pedoc
pedoc / ExtensionMethods.cs
Created July 2, 2018 10:03
byte[] -> hex string(with reversal)
public static class ExtensionMethods {
public static string ToHex(this byte[] data) {
return ToHex(data, "");
}
public static string ToHex(this byte[] data, string prefix) {
char[] lookup = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
int i = 0, p = prefix.Length, l = data.Length;
char[] c = new char[l * 2 + p];
byte d;
for(; i < p; ++i) c[i] = prefix[i];