Skip to content

Instantly share code, notes, and snippets.

@hoangitk
hoangitk / csharp_notes.md
Created July 23, 2020 04:28
[C# Localization] #dotnet

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);

@hoangitk
hoangitk / send-weixin.ps1
Created July 22, 2020 02:52
[send-weixin(wechat)] #powershell #wechat
# https://blog.51cto.com/lixiaosong/1689886
function send-weixin {
Param(
[Parameter(Mandatory = $True, Position = 1)]
[String]$Username,
[Parameter(Mandatory = $True, Position = 2)]
[String]$Content
)
$auth_string = https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=【你自己的Corpid】&corpsecret= 【你自己的密码】
$auth_values = Invoke-RestMethod $auth_string
@hoangitk
hoangitk / git_submodules.md
Created June 29, 2020 07:22 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@hoangitk
hoangitk / Find_and_Replace.md
Created June 26, 2020 07:51
[Find and Replace] #tips #regex

Find and Replace tips

Regex

  • Find All a tag with bookmark
     <a.+?\s*href\s*=3D\s*["\']?([^"\'\s>]+\#(\w*))["\']?
@hoangitk
hoangitk / SqlKataExample.cs
Created June 23, 2020 06:49 — forked from benmccallum/SqlKataExample.cs
Optimized, cursor-based paging for connections with MS SQL CTEs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using AutoGuru.Client.Shared;
using AutoGuru.Client.Shared.Dtos;
using AutoGuru.Client.Shared.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@hoangitk
hoangitk / Self-signed SSL.md
Last active June 18, 2020 07:42
[Self-signed SSL] #hosting #ssl

Self-signed SSL

Powershell

 New-SelfSignedCertificate -DnsName *.clientcert.test -CertStoreLocation cert:\LocalMachine\My

CARoot

makecert.exe ^
@hoangitk
hoangitk / ngrok.md
Created June 17, 2020 02:43
[ngrok] #ngrok #hosting

Ngrok

Start

  • ngrok start --all --config=ngrok.yml
@hoangitk
hoangitk / A New Pattern for Exception Logging.md
Created June 12, 2020 17:11
[A New Pattern for Exception Logging] #dotnet #csharp #exception
@hoangitk
hoangitk / chrome-base_tips.md
Last active June 9, 2020 08:37
[Chrome-base Tips] #tips #browser

Chorme Tips

Paths

  • Brave: "C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe"
  • MS Edge: "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"

Startup options

  • with profile: --profile-directory="Profile 2"
  • with incognito: --incognito
  • with dev tools: --auto-open-devtools-for-tabs
@hoangitk
hoangitk / robocopy.md
Last active June 26, 2020 07:22
[Robocopy] #sync #collection #tools

Robocopy

Sync LEFT => RIGHT

> robocopy "src" "dest" /e /XA:SH /XJD /R:5 /W:15 /MT:4 /NDL /NP /LOG:Sync.log

Mirror LEFT => RIGHT

> robocopy "src" "dest" /MIR /XA:SH /XJD /R:5 /W:15 /MT:4 /V /NP /LOG:Mirror.log