Skip to content

Instantly share code, notes, and snippets.

module.exports = {
publicPath: "/",
devServer: {
proxy: {
"^/api": {
target: "https://localhost:5001/",
ws: true,
changeOrigin: true,
},
},
git checkout <branch>
git reset $(git merge-base develop $(git branch --show-current))
git add *
git commit -m "Comments ..."
git push --force
@voquanghoa
voquanghoa / Convert IIS PFX.md
Created January 5, 2021 05:18
Convert certification to IIS pfx
openssl pkcs12 -export -in certificate.crt -inkey private.key -out output.pfx
@voquanghoa
voquanghoa / Disable Macbook Play button.md
Last active December 31, 2020 11:14
Disable iTunes (or Music) auto launch when click the play button (often by accident)

Disable

launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist

Enable

@voquanghoa
voquanghoa / DotnetCoreCLI.md
Created June 25, 2020 03:44
Dotnet Core Useful Commands

Create new solution

dotnet new sln

The solution file has the same name to the contains directory (current directory)

Create project WebClient with angular as frontend

@voquanghoa
voquanghoa / Android Useful Commands.md
Last active March 18, 2022 16:07
Some useful adb commands for all developers

1. Get Device local IP

adb shell ifconfig wlan0

2. Wireless ADB

adb tcpip 5556
fun combinationSum(candidates: IntArray, target: Int): List<List<Int>> {
val counts = IntArray(candidates.size){0}
val result = mutableListOf<List<Int>>()
fun gen(i: Int, newTarget: Int){
if(newTarget < 0){
return
}
if(newTarget == 0){
result.add((0 until i).flatMap {x -> (0 until counts[x]).map { candidates[x] } })
int sequenceElement(int[] a, int n)
{
int number = a[0] * 10000 + a[1] * 1000 + a[2] * 100 + a[3] * 10 + a[4];
int beginer = number;
if (n < 5)
{
return a[n];
}
var list = new List<int>();
@voquanghoa
voquanghoa / ContextExts.kt
Last active March 25, 2019 08:01
Snipet to read file from asset/internal storage on Android with Kotlin
import android.content.Context
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
/**
* Created by Hoa Vo on 1/18/19.
*/
fun Context.readAssetAsString(fileName: String): String = this.assets.open(fileName).use {
String(it.readBytes())
}
public static void SaveJson<T>(List<T> data, string directory)
{
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
var fileName = $"{typeof(T).Name}s.json";
var filePath = Path.Combine(directory, fileName);
var json = JsonConvert.SerializeObject(data);