Skip to content

Instantly share code, notes, and snippets.

View Y2Nk4's full-sized avatar

Jiahao(Jayce) Guo Y2Nk4

View GitHub Profile
@Y2Nk4
Y2Nk4 / NppExec_nanopb_generator
Last active September 3, 2020 20:31
NppExec Script to generate nanopb files automatically
cmd /c mkdir $(CURRENT_DIRECTORY)\generated_nanopb
protoc -o $(CURRENT_DIRECTORY)\generated_nanopb\tmp.pb --proto_path $(CURRENT_DIRECTORY) $(FULL_CURRENT_PATH) --experimental_allow_proto3_optional
nanopb_generator $(CURRENT_DIRECTORY)/generated_nanopb/tmp.pb --output-dir "$(CURRENT_DIRECTORY)\generated_nanopb"
cmd /c del $(CURRENT_DIRECTORY)\generated_nanopb\tmp.pb
@Y2Nk4
Y2Nk4 / set-up-github.bat
Last active August 9, 2020 04:56
Add `Open with GitHub Client` to Windows right click context menu
@echo off
:: Needs to be run as administrator.
:: Needs to save as ANSI format
:: Change the paths below to match your GitHub Client's path.
SET IconPath=C:\Users\UserName\AppData\Local\GitHubDesktop\app.ico
SET LaunchPath=C:\Users\UserName\AppData\Local\GitHubDesktop\bin\github.bat
echo Adding within a folder entries
@Y2Nk4
Y2Nk4 / shell.bat
Last active August 9, 2020 03:22
Script to add `Open folder as xxx Project` for JetBrains IDEs
@echo off
:: Save as ANSI format if the path has Chinese characters
:: 若路径中含有中文字符,需要保存为ANSI格式
:: Change the paths below to match the desired IDE.
:: Make sure you don't quote any of the paths in following lines, spaces are allowed.
SET LaunchPath=C:\Users\MyUser\AppData\Local\JetBrains\Scripts\pycharm.cmd
SET IconPath=C:\Users\MyUser\AppData\Local\JetBrains\Scripts\icons\pycharm.ico
SET AppName=PyCharm
@Y2Nk4
Y2Nk4 / vesta_email_script.php
Created May 7, 2019 22:31 — forked from yasinkuyu/vesta_email_script.php
Create email account vesta script
<?php
// Server info
$vst_hostname = 'server.vestacp.com';
$vst_username = 'admin';
$vst_password = 'p4ssw0rd';
$vst_returncode = 'yes';
$vst_command = 'v-add-mail-account';
// New account info