Skip to content

Instantly share code, notes, and snippets.

@voquanghoa
voquanghoa / SuggestComboBox.cs
Last active March 10, 2024 11:07
C# SuggestCombobox
public class SuggestComboBox : ComboBox
{
#region fields and properties
private readonly ListBox suggestionListBox = new ListBox { Visible = false, TabStop = false };
private readonly BindingList<string> suggBindingList = new BindingList<string>();
private Expression<Func<ObjectCollection, IEnumerable<string>>> propertySelector;
private Func<ObjectCollection, IEnumerable<string>> propertySelectorCompiled;
private Expression<Func<string, string, bool>> filterRule;
module.exports = {
publicPath: "/",
devServer: {
proxy: {
"^/api": {
target: "https://localhost:5001/",
ws: true,
changeOrigin: true,
},
},
@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
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

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())
}