Skip to content

Instantly share code, notes, and snippets.

View zengjiapei3000's full-sized avatar
🍔
enjoy eating!

justgoooooo zengjiapei3000

🍔
enjoy eating!
  • China
View GitHub Profile
PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2
## or
PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>/tmp/$(uuidgen)
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="D:\Applications\Scoop\apps\msys2\current\ucrt64" ..
make -j8 install
cmake -G Ninja "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="D:\Applications\Scoop\apps\msys2\current\mingw64" -DCMAKE_CXX_COMPILER='g++' -DCMAKE_C_COMPILER='gcc' ..
CMake Warning:
Ignoring extra path from command line:
"D:/Applications/Scoop/apps/msys2/2023-01-27/usr/src/tdlib/build/Unix Makefiles"
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。

@echo off
setlocal EnableDelayedExpansion
set "WD=%__CD__%"
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"
set "LOGINSHELL=bash"
set /a msys2_shiftCounter=0
rem To activate windows native symlinks uncomment next line
REM set MSYS=winsymlinks:nativestrict
@zengjiapei3000
zengjiapei3000 / 📊 Weekly development breakdown
Last active February 6, 2023 01:17
📊 Weekly development breakdown
Python 5 hrs 6 mins ███████████████▉░░░░░ 75.6%
Markdown 1 hr 15 mins ███▉░░░░░░░░░░░░░░░░░ 18.7%
Other 19 mins █░░░░░░░░░░░░░░░░░░░░ 4.9%
INI 2 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.7%
JSON 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%
$ curl \
-X POST \ // -X means
-H "Accept: application/vnd.github.v3+json" \ // -H means -H "Authorization: token (base64 code)"
https://api.github.com/user/repos \
-d '{"name":"name"}' // -d means data
// another options: -i means add the flag to include headers.
// -u means Use a flag to set your username(only Using personal access tokens)
$ curl -i -H "Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4" \
-d '{ \
@zengjiapei3000
zengjiapei3000 / ConvertIntarrayToChararray.cs
Last active December 12, 2020 13:33
In csharp, how to convert intArray to chararray, and the difference of csharp 2 and 3.
public class ConvertIntarrayToChararray
{
public int FindMaxConsecutiveOnes(int[] nums) {
char[] numsToChars = new char[nums.Length];
numsToChars = nums.ConvertAll<int, char>(nums, c => char.Parse(c)); // C# 3.0
// In C# 2.0, replaced the above code to :
// numsToChars.ConvertAll<int, char>(nums, delegate(int c) { return char.Parse(c)});
}
}