Skip to content

Instantly share code, notes, and snippets.

View weihanglo's full-sized avatar

Weihang Lo weihanglo

View GitHub Profile
@weihanglo
weihanglo / how-is-new-terminal-in-vs-code-so-fast.md
Last active October 27, 2021 02:18
How Is New Terminal In VS Code So Fast?

Last week, a new version (1.17) of Visual Studio Code was released. While there are many fascinating improvements and features introduced, the one that cought my eyes is "Integrated Terminal performance" section. Let's check out what they've done!

(written on 2017-10-12, based on Xterm.js v3, VS Code 1.17)

Old Performance Issue

I/O Redirection 常用指令紀錄

greptrsedawk 是幾個很常見的標準串流 [Standard Streams][1] 處理工具,靠著regex的加持,這些工具使用在 I/O redirection 比起寫個python script快多了,唯一的壞處就是options太多,容易遺忘。本文主要紀錄上述工具使用筆記與心得。

(撰於 2016 年年初,致青春)

sed

sedStream EDitor 的縮寫,最常用來處理pipeline。特色是一次只讀取一行input到buffer處理,導向至「標準輸出(STDOUT)」後,再處理下一行。

@weihanglo
weihanglo / binary-data-manipulations-in-javascript.md
Last active December 2, 2021 05:47
Binary Data Manipulations in JavaScript

使用 JavaScript 處理二進位資料

由於高度封裝與抽象,JavaScript 的執行效率比不上 C 的語言。例如 JavaScript 的 Array 下標(subscript)是根據 hash key 而非實體記憶體位址 offset 取值,雖然方便,卻多了效能開銷。當 Canvas、WebGL、WebVR 開始走紅,效能越來越受重視,如何讓 JavaScript 達到如同 C 指標般操作 binary data 變得至關重要。

存在許久但最近才變為 ES6 標準「Typed Array」就是解放 JavaScript 操作 binary data 能力的好工具!一起來了解 Typed Array 吧!

(撰於 2017-09-03,基於 ECMAScript 6+,Node.js 8.3)

@weihanglo
weihanglo / .editorconfig
Created August 16, 2017 17:03
Editorconfig for web development
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@weihanglo
weihanglo / intro-rx-0-reactivex.md
Last active August 22, 2017 12:52
Intro of ReactiveX

Intro of ReactiveX

聽過 Reactive Programming 嗎?ReactiveX(Rx)是近來火紅的技術,帶動函數響應式程式設計的熱潮。本系列將從 Rx 最原始的概念解釋起,一步步認識 Rx 巧妙的設計理念。期盼讀完後,人人心中都能有 Reactive 的思維!

(撰於 2017-08-15)

@weihanglo
weihanglo / intro-rx-1-iterator-pattern.md
Last active August 20, 2017 05:06
Intro Rx - 1. Iterator Pattern

Intro Rx - 1. Iterator Pattern

本篇介紹 Rx 的重要基礎概念 Iterator pattern

(撰於 2017-08-15,基於 Swift 3.1)

Definition

@weihanglo
weihanglo / intro-rx-2-observer-pattern.md
Last active August 20, 2017 05:27
Intro Rx - 2. Observer Pattern

Intro Rx - 2. Observer Pattern

本篇介紹 Rx 另一個重要的基礎概念 Observer pattern

(撰於 2017-08-15,基於 Swift 3.1)

Definition

@weihanglo
weihanglo / thoughts-on-react-native-from-an-ios-developer.md
Last active August 2, 2023 16:51
Thoughts on React Native from an iOS developer

Thoughts on React Native from an iOS developer

React Native

About two month ago, I started making a React Native app ["PyConTW 17"][pycontw-mobile] for the biggest annual Python conference in Taiwan ([PyCon Taiwan][pycontw]). The app is quite simple, but still took some efforts for me to build. As a complete React newbie, I would like to share some of my thoughts about React Native.

(written on 2017-07-30, based on React Native 0.44.2)

@weihanglo
weihanglo / answers-to-cherny-interview-questions.md
Last active March 2, 2021 06:47
Answers to Cherny's Interview Questions

Answers to Cherny's Interview Questions

這份面試題出自[於此][questions-source],是從 [/r/Frontend/][reddit-frontend] 連結過去的,看到如此自豪的標題和簡介,便手癢來作答。結果寫完基礎概念篇,才發現這份題目在 reddit 上被批評到體無完膚,與現代前端技術棧相差頗大。不過,一些核心概念還是挺重要的,在此分享小弟的答案,有任何錯誤,請各位不吝賜教。

(撰於 2017-07-26)

Concepts

@weihanglo
weihanglo / days-with-internet-explorer.md
Last active January 11, 2022 09:39
與 IE 相處的日子

與 IE 相處的日子

近幾年來,JavaScript 可謂風生水起,從後端到前端,從 mobile 到 desktop,各種 module 滿天飛,信手拈來就是一個 web app。不過,「沒碰過 IE,別說你會做前端」,本人從超新手的角度出發,整理最近修正 IE 相容性遇到的坑與解法,給自己日後留個參考。

(撰於 2017-07-15,基於 IE 11/Edge 15)

Contents