Skip to content

Instantly share code, notes, and snippets.

View poychang's full-sized avatar
🌠
Magic Transforms the World

Poy Chang poychang

🌠
Magic Transforms the World
View GitHub Profile
@poychang
poychang / Note.md
Created May 10, 2024 09:17
Find Non-UTF8 Encoded Characters using Visual Studio Code (VS Code)

I ran into a problem with python where a file I wanted to read in and parse contained unexpected non-UTF-8 encoded characters. I am certain there are many ways to solve this problem, but capturing my quick and dirty appraoch below for posterity.

  1. Open the file and the Open Find
  2. In find, copy/paste the regex below:
^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|[\xEE-\xEF][\x80-\xBF]{2}|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$
  1. VS Code will highlight the lines MATCHING UTF encoded characters. So, you just have to skim the file looking for lines without highlighting.
@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 / 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 / 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 / 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

@poychang
poychang / vue.md
Last active November 4, 2019 00:07 — forked from oomusou/vue.md
[Functional Vue Architecture] 你應該用 Functional 的方式來想怎麼寫 Vue #vue

Functional Vue Architecture

Sam Xiao, Feb.18, 2019

Web 所面臨的挑戰

後端 MVC

約在 2015 年,主流的 Web 開發架構仍以後端 MVC 為主:

@poychang
poychang / Convert-PCL-to-Dotnet-Standard.md
Last active November 9, 2018 09:16 — forked from yuv4ik/README.md
[將 PCL 轉換成 .NET Standard] #dotnet #xamarin
@poychang
poychang / updateNpm.bat
Created November 2, 2018 03:42 — forked from johnmcase/updateNpm.bat
Update npm on windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@poychang
poychang / Visual Studio Code - Dark.ps1xml
Last active October 11, 2018 05:52 — forked from stuartleeks/Visual Studio Code - Dark.ps1xml
Powershell ISE theme - VS Code Dark
<?xml version="1.0" encoding="utf-16"?>
<StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Keys>
<string>ErrorForegroundColor</string>
<string>ErrorBackgroundColor</string>
<string>WarningForegroundColor</string>
<string>WarningBackgroundColor</string>
<string>VerboseForegroundColor</string>
<string>VerboseBackgroundColor</string>
<string>DebugForegroundColor</string>
@poychang
poychang / README.md
Last active August 29, 2019 09:25 — forked from doggy8088/settings.json
Poy Chang 的 VSCode 使用者設定檔

editor

  • "editor.minimap.enabled": true
    • 在捲軸上開啟 MiniMap 功能。
  • "editor.minimap.renderCharacters": false
    • 如果開啟 MiniMap 的話,預設會顯示實際字元 (字超小),根本看不清楚。
    • 將這個設定關閉,就會改顯示彩色區塊而已,這會讓 VSCode 反應速度更快。

files