Skip to content

Instantly share code, notes, and snippets.

View poychang's full-sized avatar
🏠
Stay Home & Be Health

Poy Chang poychang

🏠
Stay Home & Be Health
View GitHub Profile
@poychang
poychang / Install Android apps or apk files in Windows using Windows Subsystem for Android (No Emulator).md This Guide will show you how to install and run apk files or Android apps in any Edition of Windows 11 using Windows Subsystem for Android. WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator.

Install Android apps or apk files in Windows using Windows Subsystem for Android

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow my guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • Windows Subsystem for Android or WSA must be Installed.

Click here to view the guide that shows how to install Windows Subsystem for Android in any Edition of Windows 11 (including Windows 11 Home) non Inider or stable release.

How to Install Android Apps or apk files in Windows Subsystem for Android:

@poychang
poychang / Benchmark 效能測試樣板.linq
Created September 28, 2022 02:48
[LINQPad - Benchmark 效能測試樣板] 簡單驗證執行效能
#LINQPad optimize+
BenchmarkRunner.Run<BenchmarkJob>();
[SimpleJob(RunStrategy.ColdStart, targetCount: 10)]
[MemoryDiagnoser]
public class BenchmarkJob
{
[Benchmark]
public void Method1()
@poychang
poychang / youtube-dl.md
Created July 28, 2021 02:45 — forked from edgardo001/youtube-dl.md
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

@poychang
poychang / ThenExtension.cs
Last active September 28, 2022 02:47
[LINQ 擴充 - 然後呢] "然後呢"擴充方法 #C# #dotnet
public static class ThenExtension
{
/// <summary>
/// "然後呢"擴充方法
/// </summary>
/// <typeparam name="T">原本的物件型別</typeparam>
/// <param name="instance">原本的物件</param>
/// <param name="fn">然後你要執行什麼,並回傳變更後的物件</param>
/// <returns>原本的物件,可能會變更原本物件的屬性值</returns>
public static T Then<T>(this T instance, Func<T, T> fn) => fn(instance);
@poychang
poychang / main.cs
Created March 2, 2021 01:17
[Self Instance 的寫法] 簡單的 Singleton 寫法 #dotnet #c
void Main()
{
var instance1 = SampleService.Instance;
var instance2 = SampleService.Instance;
Console.WriteLine(instance1.WhoAmI().Equals(instance2.WhoAmI()) ? "It's the same instance." : "It's NOT the same instance.");
Console.WriteLine();
var instanceWithCtor1 = SampleServiceWithCtor.SelfInstance("Poy Chang");
var instanceWithCtor2 = SampleServiceWithCtor.SelfInstance("Poy Chang");
@poychang
poychang / WmiSearcher.cs
Created June 15, 2020 15:31
[WMI Searcher] 返回容易存取的物件
void Main()
{
GetComponent("Win32_PhysicalMemory")
.Select(p => p.ToObject<Win32_PhysicalMemory>())
.ToList()
.ForEach(item => Console.WriteLine(item.Manufacturer));
}
/// <summary>
/// 取得指定硬體設備類別的所有屬性資料
@poychang
poychang / README.md
Created March 25, 2020 10:03 — forked from magnetikonline/README.md
PowerShell Import-Module with .ps1 quirk.

PowerShell Import-Module with .ps1 quirk

Well, not so much a quirk - but an interesting anti-pattern I found in some (poor quality) PowerShell. Documenting the "how and why" so I can refer to it again if needed!

Example

We have two files callme.ps1 and functions.ps1:

functions.ps1:

@poychang
poychang / rangeGenerator.js
Created March 4, 2020 01:25
[比較 Array 和 Generator 的作法]
// 搭配 Quokka.js 來測試會比較方便看
function* rangeGenerator(start, end) {
for (let i = start; i < end; i++) yield i;
}
function range(start, end) {
return Array.from({ length: end - start }, (_, i) => i + start);
}
@poychang
poychang / github-markdown.css
Created December 20, 2019 06:18
Markdown to HTML style sample
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAA
@poychang
poychang / embedded-file-viewer.md
Created December 5, 2019 16:25 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links