Skip to content

Instantly share code, notes, and snippets.

View javascripter's full-sized avatar

javascripter

View GitHub Profile
@javascripter
javascripter / yuku-i18n-key-extraction-demo.ts
Created August 4, 2026 15:03
i18n translation key example for Yuku compiler toolchain
import { analyze } from 'yuku-analyzer'
import { expect, test } from 'vitest'
// https://yuku.fyi/analyzer/
// Extracts i18n keys into an array of strings
// t('demo') -> ['demo']
function extractTranslationKeys(source: string): string[] {
const module = analyze(source, { path: 'input.ts' })
const keys: string[] = []
@javascripter
javascripter / expo-local-cache-provider.cjs
Last active July 30, 2026 10:38
expo/local-build-cache-provider with worktree support
const childProcess = require("node:child_process");
const fs = require("node:fs");
const path = require("node:path");
const localBuildCacheProvider = require("expo/local-build-cache-provider").default;
const cacheKeyVersions = { android: "v1", ios: "v1" };
function runGit(projectRoot, args) {
return childProcess
.execFileSync("git", args, {
@javascripter
javascripter / define.md
Created March 18, 2026 15:03
A prompt for extracting vocabulary from websites for English learning

You are helping an advanced English learner (TOEIC ~970, software engineer with Computer Science background in English).

Task

Extract vocabulary, abbreviations, idioms, and domain-specific terms from the provided text (may be the web page or the selected text) that an advanced non-native reader might not fully recognize.

Focus especially on:

  • journalism shorthand
  • proper nouns that require background knowledge
  • terminology
@javascripter
javascripter / eas-rollout.yml
Created July 28, 2025 08:22
Canary EAS Rollout workflow (using PR label)
name: EAS Rollout
on:
pull_request:
types: [labeled, unlabeled, closed, synchronize]
permissions:
pull-requests: write
contents: read
/**
* A file-system based build cache provider for `expo run:[android|ios]`.
* Available in Expo SDK 53+.
* https://docs.expo.dev/guides/cache-builds-remotely/
*
* This plugin speeds up local rebuilds by caching `.apk` or `.app` outputs on disk,
* based on a stable fingerprint hash provided by Expo CLI.
*
* Usage:
* 1. Save this file as `provider.plugin.js` in your project root.
@javascripter
javascripter / next.config.ts
Created April 24, 2025 14:15
React Strict DOM + Next.js with support for both Webpack and Turbopack
import type { NextConfig } from 'next'
function getBabelLoader() {
const dev = process.env.NODE_ENV !== 'production'
return {
loader: 'babel-loader',
options: {
parserOpts: {
plugins: ['typescript', 'jsx'],
},
@javascripter
javascripter / Ratings.tsx
Created November 27, 2024 20:16
A hand-optimized React Ratings Component that doesn't render multiple SVGs. Supports fractional values.
import * as React from 'react'
export function Ratings({
value,
width = 18,
height = 16,
gap = 2,
maxStars = 5,
color = '#f39c12',
}: {
@javascripter
javascripter / next.config.ts
Created November 26, 2024 12:10
Next.js + Turbopack + PostCSS example
// next.config.mjs
import type { NextConfig } from 'next'
function getBabelLoader() {
return {
loader: 'babel-loader',
options: {
presets: [
[
'next/dist/compiled/babel/preset-typescript',
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
const fs = require('fs');
@javascripter
javascripter / useIsMachineTranslationEnabled.ts
Last active November 25, 2024 19:29
Detection of Google Translate Usage in React
import * as React from 'react'
export function useIsMachineTranslationEnabled() {
const [isMachineTranslationEnabled, setIsMachineTranslationEnabled] =
React.useState(false)
React.useEffect(() => {
if (isMachineTranslationEnabled) {
return
}