Skip to content

Instantly share code, notes, and snippets.

View zetavg's full-sized avatar

Pokai Chang zetavg

View GitHub Profile
@zetavg
zetavg / Configure_Sublime_Text_LSP-Pyright_to_Use_the_Conda_Env_for_a_Project.md
Created April 30, 2023 17:55
Configure Sublime Text LSP-pyright to Use the Conda Env for a Project

Configure Sublime Text LSP-pyright to Use the Conda Env for a Project

First, use the command conda info --envs to find the path of a specific environment created with conda.

$ conda info --envs
# conda environments:
#
base                     /Users/z/miniconda3
some-env              *  /Users/z/miniconda3/envs/some-env
@zetavg
zetavg / 0_Old Adobe iOS app icons.md
Last active April 30, 2023 17:56
Old Adobe iOS app icons

Old Adobe iOS app icons

Extracted from .ipa files or App Store. Just for those who want it.

@zetavg
zetavg / README.md
Created October 10, 2022 04:18
Apple Shortcut for creating a long-term (per day) stock chart that can be used as a widget with Charty.

Apple Shortcut: Long-term Stock Chart with Charty

Apple Shortcut for creating a long-term (per day) stock chart that can be used as a widget with Charty.

Requirements

@zetavg
zetavg / firstrade-to-yahoo-finance-import.js
Last active October 10, 2022 04:25
Script to import Firstrade positions into Yahoo Finance as Portfolio.
/*
* 1. Sign in to Firstrade's positions page (https://invest.firstrade.com/cgi-bin/main#/cgi-bin/acctpositions).
* 2. Open DevTools (Command + Option + i) JS console (Esc), paste the code below. Then stuff will be copied.
* 3. Open a new text file, paste the copied content into it and save it as *.csv.
* 4. Go to the Portfolios page on Yahoo Finance (https://finance.yahoo.com/portfolios), click "Import" and upload the file created on step 3.
* 5. You now have a new portfolio imported from your Firstrade positions data (you might want to rename it).
*/
function getPositionTable() {
@progrium
progrium / README.md
Last active October 17, 2021 18:33
Large Type CLI utility for Mac in less than 80 lines of Go

largetype

largetype screenshot

Building

Note: For now, Apple Silicon users need to be set up for x86 mode

First, download Go or brew install go. Then, put largetype.go in a directory called largetype and from there run:

$ go mod init largetype
@coodoo
coodoo / statechart-xstate.md
Last active May 26, 2022 20:00
Extensive research of statecharts with a focus on front-end development.

The case for statechart and xstate -- why it matters and how we can benefit from it

Bottom line up front

  • redux is a global data management tool, not a proper state management tool, hence causing a lot of troubles

  • statecharts is an extension to Finite State Machine (FSM) which provides explicit and safe state management capabilities, perfectly fit for front-end development

  • statecharts had been used intensivelly in all industries (be it embedded systems, hardware, electronics, aeronautics, automotive, game development and more), it's us front-end developers late to the party

@zetavg
zetavg / README.md
Last active April 30, 2023 17:59
用 Haskell 的 list comprehension 來解某數學愛好者社團的某題目 (https://www.facebook.com/photo.php?fbid=2475098332534617)
@zetavg
zetavg / sb-calibre-azw3-kindle.md
Last active April 11, 2024 19:14
直書書籍用 Calibre 轉 azw3 在 Kindle 上跑版(翻頁相反、字體走位)的解決方法。

直書書籍用 Calibre 轉 azw3 在 Kindle 上跑版的解決方法

圖為修正後範例。

有些直書書籍轉成 azw3 後排版會跑掉,在 Kindle 上僅剩翻頁變相反、從左到右的(因為原本是直書呀)。這裡是一些解決方法。

首先對要修正的書按右鍵選編輯,然後選 AZW3

1. 直書變橫書

@qoomon
qoomon / conventional_commit_messages.md
Last active May 24, 2024 22:21
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@zetavg
zetavg / generateTaskPaperFromTOC.js
Created October 20, 2018 16:03
Generate TaskPaper to track progress of reading the CSS specifications on www.w3.org.
/**
* Execute this function on a CSS spicificaiton page to get TaskPaper tasks.
*/
function generateTaskPaperFromTOC() {
function getDataFromLi(li) {
const children = Array.from(li.children)
const a = children.find(node => node.tagName === 'A')
const data = {
title: Array.from(a.children).map(node => node.innerText).join(' '),
url: a.href,