Skip to content

Instantly share code, notes, and snippets.

View pqviet07's full-sized avatar
🎯
Focusing

Phung Quoc Viet pqviet07

🎯
Focusing
View GitHub Profile
@pqviet07
pqviet07 / .clang-format
Created August 4, 2024 08:04
My clang-format
BasedOnStyle: Google
UseTab: true
IndentWidth: 8
InsertBraces: true
AllowShortIfStatementsOnASingleLine: Never
AllowShortBlocksOnASingleLine: Never
BreakBeforeBraces: Attach
AllowShortFunctionsOnASingleLine: None
ColumnLimit: 200
@pqviet07
pqviet07 / README.md
Created July 13, 2023 01:16 — forked from lopspower/README.md
All Android Directory Path

All Android Directory Path

Twitter

1) System directories

⚠️ We can't write to these folers

Method Result
@pqviet07
pqviet07 / Open with Android Studio.cmd
Created July 9, 2023 09:10 — forked from kumaran-IV0IV/Open with Android Studio.cmd
Add `Open with Android Studio` to Windows right click context menu
@echo off
:: change the path below to match your installed version
SET AndroidStudioPath=C:\Program Files\Android\Android Studio\bin\studio64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_SZ /v "" /d "Open with AndroidStudio" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio" /t REG_EXPAND_SZ /v "Icon" /d "%AndroidStudioPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\AndroidStudio\command" /t REG_SZ /v "" /d "%AndroidStudioPath% \"%%1\"" /f
@pqviet07
pqviet07 / gist:33db2def25952ffe5b21e854a60b2783
Created July 2, 2023 03:06 — forked from nguditi/gist:27c81a205cc5e7697984c0d3ecf026ad
Build FFmpeg static lib in Window using MSYS2 and MSVC 2017
It's take two day searching and trying to firgure out the correct way =)))
follow https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT
-------BUT IT'S NOT WORK--------
1. Make sure SET LIB ; SET LIBPATH ; SET INCLUDE with exist and right path(version, exist binary files...)
2. Make sure evironment path, environment variables point to right value/path.
--------If still cannot build, follow my way---------
@pqviet07
pqviet07 / netcore_init.sh
Created May 28, 2023 07:31
Express Setup .Net Core App
dotnet new console -n <YourProjectName> -f net7.0 && \
cd <YourProjectName> && \
dotnet add package Microsoft.Extensions.Configuration.Json && \
dotnet add package Newtonsoft.Json && \
dotnet add package Quartz && \
dotnet add package RestSharp && \
dotnet add package Serilog && \
dotnet add package Serilog.Sinks.Console && \
dotnet add package Serilog.Sinks.File && \
dotnet add package HtmlAgilityPack && \
@pqviet07
pqviet07 / smartgit_bypass.md
Last active April 12, 2024 04:44
Bypassing SmartGit's update check popup

Nếu cần cài lại từ đầu thì set datetime về năm 2022 trước khi cài

A. Trên Ubuntu:

  1. Thêm vào file hosts

    127.0.0.1       syntevo.com
    127.0.0.1       www.syntevo.com
    # Hoặc tốt hơn thì config firewall rule (của Smartgit) sao cho chặn tất cả inbound/outbound IP ngoại trừ:
@pqviet07
pqviet07 / RWLock_std11.cpp
Last active April 12, 2023 07:26
RWLock in c++11 và c++17
#include <iostream>
#include <mutex>
#include <condition_variable>
#include <thread>
#include <vector>
class ReadWriteLock {
public:
void read(std::function<void()> reader) {
std::unique_lock<std::mutex> lock(mutex_);
@pqviet07
pqviet07 / Dotnet_Build_Run_Release.sh
Last active June 2, 2023 15:37
Kill process then build and run dotnet core app
#!/bin/bash
#Kill process then re-build and run
pid=`ps aux | grep LuongThangScraper | grep -v grep | awk {'print $2'}`
if [ -z "$pid" ]
then
echo "LuongThangScraper not found!"
else
echo "LuongThangScraper running on PID = " $pid
kill -9 "$pid"
@pqviet07
pqviet07 / NetworkInterception.cs
Last active June 3, 2023 05:10 — forked from jimevans/NetworkInterception.cs
Selenium C# network traffic logging example
public async Task LogNetworkRequests(IWebDriver driver)
{
INetwork interceptor = driver.Manage().Network;
interceptor.NetworkRequestSent += OnNetworkRequestSent;
interceptor.NetworkResponseReceived += OnNetworkResponseReceived;
await interceptor.StartMonitoring();
driver.Url = "http://the-internet.herokuapp.com/redirect";
await interceptor.StopMonitoring();
}
@pqviet07
pqviet07 / list-of-curl-options.txt
Created March 22, 2023 08:13 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password