Skip to content

Instantly share code, notes, and snippets.

View zetavg's full-sized avatar

Pokai Chang zetavg

View GitHub Profile
@zetavg
zetavg / arc-traditional-new-tab.scpt
Last active March 19, 2026 17:50
AppleScript to open a traditional new tab (with a New Tab page) in Arc browser. Bind this script to a shortcut key such as ⌘T or ⌘⇧T in tools like BetterTouchTool for Arc.
-- Can change this to your favorite new tab page extension URL, such as "chrome-extension://laookkfknpbbblfpciffpaejjkokdgca/dashboard.html"
set newTabPage to "chrome://new-tab-page/"
tell application "/Applications/Arc.app"
activate
-- tell front window to make new tab at after (get active tab) with properties {URL:"chrome://new-tab-page/"} -- not working
open location newTabPage
repeat
set windowTitle to ""
@zetavg
zetavg / open_webui-20260312.html
Created March 12, 2026 04:37
Agent session: open_webui - Currently, chat messages seems to be stored in two places: 1. The `chat` table, as JSON data in the...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>open_webui - Agent Session</title>
<style>
:root {
--bg-primary: #f7f7fa;
--bg-surface: #ffffff;
@zetavg
zetavg / sb-calibre-azw3-kindle.md
Last active November 26, 2025 16:52
直書書籍用 Calibre 轉 azw3 在 Kindle 上跑版(翻頁相反、字體走位)的解決方法。

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

圖為修正後範例。

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

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

1. 直書變橫書

@zetavg
zetavg / github-copilot-instructions-to-claude-code-memories.mjs
Last active August 5, 2025 04:59
A script that creates symlinks from GitHub Copilot instruction files to Claude Code memory files (CLAUDE.md), allowing you to share the same instructions between both AI coding assistants.
#!/usr/bin/env node
/**
* Creates symlinks from GitHub Copilot instruction files to Claude Code memory files (CLAUDE.md), allowing you to share the same instructions between both AI coding assistants.
*
* Quick usage:
*
* ```bash
* curl -s https://gist.githubusercontent.com/zetavg/6c66232174bbaf3c132f176f11339751/raw/github-copilot-instructions-to-claude-code-memories.mjs | node --input-type=module
* ```

Error Messages

> Task :app:compileReleaseKotlin FAILED
e: file:///.../android/app/src/main/java/.../MainActivity.kt:11:8 Unresolved reference: expo
e: file:///.../android/app/src/main/java/.../MainActivity.kt:33:12 Unresolved reference: ReactActivityDelegateWrapper
e: file:///.../android/app/src/main/java/.../MainApplication.kt:16:8 Unresolved reference: expo
e: file:///.../android/app/src/main/java/.../MainApplication.kt:17:8 Unresolved reference: expo
e: file:///.../android/app/src/main/java/.../MainApplication.kt:21:51 Unresolved reference: ReactNativeHostWrapper
e: file:///.../android/app/src/main/java/.../MainApplication.kt:41:13 Unresolved reference: ReactNativeHostWrapper
@zetavg
zetavg / README.md
Last active November 21, 2024 06:38
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

{
"Contrast colors": {
"contrastActiveBorder": {
"description": "An extra border around active elements to separate them from others for greater contrast.",
"required": false
},
"contrastBorder": {
"description": "An extra border around elements to separate them from others for greater contrast.",
"required": false
}

How React Native Bundles JS on Build

We want to know how React Native will be bundling the JavaScript code and assets during the build of iOS or Android native apps.

Updated on June 2024.

Apple

import { useEffect } from 'react';
import registerRootComponent from 'expo/build/launch/registerRootComponent';
/* PASTE THE CODE HERE */
function App() {
useEffect(() => {
const timer = setTimeout(() => {
const iterations = 1e6;

{propName}IsStable

Setting this to true means that the {propName} prop of the component should be treated as a stable, dependency-free value - i.e. it only references values that will not change between renders (such as refs and setState functions), or in another way to say, shall be safe to pass into the useCallback hook without any specifying any dependencies.

<Button onPressIsStable onPress={() => Alert.alert('Pressed')} /

This is a performance optimization to prevent unnecessary re-renders of the component, and should only be used when the propName function is guaranteed to be stable.