Skip to content

Instantly share code, notes, and snippets.

@tzuhsun
tzuhsun / git push error.txt
Created January 30, 2024 11:06
'git push' error if the total files > 30
In 'git push' command, if the total files > 30, most likely will encounter error below:
==============================
Just anecdotally, I ran into this problem today with curl 8.0.1.0 on Windows 11, version 22H2. I was trying to push a commit involving ~30 files to an existing branch of an ADO repo, and the error output was:
Total 96 (delta 61), reused 0 (delta 0), pack-reused 0
error: RPC failed; curl 56 HTTP/2 stream 7 was reset
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
@tzuhsun
tzuhsun / git alias
Last active February 18, 2022 03:42
How to add an alias permanently for the Git Bash
To add an alias permanently, you'd need to edit the file. /C/Program Files/Git/etc/profile.d/aliases.sh
1. Run your text editor as an administrator and open that file.
2. Add your alias and save the file.
3. Open the Git Bash in Administration mode. Execute 'alias', and you're done. Have fun.
Example:
alias gs='git status'
@tzuhsun
tzuhsun / printf data type
Created June 6, 2020 14:57
C++ printf % placeholder for data types
Visual Studio printf placeholder
std::wstring textW = L"wide string";
syslog(LOG_DEBUG, "S=%S, ls=%ls\n", testW.c_str(), testW.c_str());
@tzuhsun
tzuhsun / settings.json
Last active November 20, 2018 09:56
This is the settings for https://github.com/fabiospampinato/vscode-highlight to highlight keywords in log file. Highlight rules are same with <script src="https://gist.github.com/tzuhsun/97a4b17c49505b5affb68df9f00434ab.js">tzuhsun/LogFile_UDL.xml</script>
// This is the settings for https://github.com/fabiospampinato/vscode-highlight
// to highlight keywords in log file.
// Highlight rules are same with <script src="https://gist.github.com/tzuhsun/97a4b17c49505b5affb68df9f00434ab.js"></script>
// Begin here
{
"workbench.colorTheme": "Solarized Dark",
"workbench.sideBar.location": "left",
"highlight.maxMatches": 0, // 0 - infinity
"highlight.regexes": {
@tzuhsun
tzuhsun / LogFile_UDL.xml
Last active October 27, 2021 02:24
Notepad++ user defined language for log file (Tested with UDL v2.1.0.12)
<NotepadPlus>
<UserLang name="LogFile" ext="log" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="2" />
<Prefix Keywords1="yes" Keywords2="yes" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="yes" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2">1 2 3 4 5 6 7 8 9 0</Keywords>
@tzuhsun
tzuhsun / C++ sleep
Last active January 4, 2018 09:07
C++ 11 sleep function
// Reference
// https://github.com/ErikDubbelboer/node-sleep/issues/24
#include <chrono>
#include <thread>
std::this_thread::sleep_for(std::chrono::nanoseconds(ssec)); /* signed integer of 64+ bits */
std::this_thread::sleep_for(std::chrono::microseconds(usec)); /* signed integer of 55+ bits */
std::this_thread::sleep_for(std::chrono::milliseconds(ms)); /* signed integer of 45+ bits */
std::this_thread::sleep_for(std::chrono::seconds(sec)); /* signed integer of 35+ bits */