Skip to content

Instantly share code, notes, and snippets.

View chalkygames123's full-sized avatar
Uncaught TypeError: Cannot read property 'status' of undefined

Takuya Fukuju chalkygames123

Uncaught TypeError: Cannot read property 'status' of undefined
  • Rhelixa Inc.
  • Hedonic Treadmill, Japan
  • 13:42 (UTC +09:00)
View GitHub Profile
@chalkygames123
chalkygames123 / stringify-error-chain.ts
Created February 5, 2026 17:00
Utility to recursively stringify and error object with causes
export const stringifyErrorChain = (error: unknown, level = 0) => {
let current: unknown = error;
const lines: string[] = [];
while (current instanceof Error) {
const indent = ' '.repeat(level);
lines.push(`${indent}${current.name}: ${current.message}`);
current = current.cause;
@chalkygames123
chalkygames123 / disable-all-transitions.css
Last active January 29, 2026 03:50
CSS to disable all transitions
:is(.no-transition, .no-transition *) {
/* biome-ignore lint/complexity/noImportantStyles: because it is truly necessary */
transition: none !important;
&::before,
&::after {
/* biome-ignore lint/complexity/noImportantStyles: because it is truly necessary */
transition: none !important;
}
}
@chalkygames123
chalkygames123 / is-retryable-http-status-code.ts
Last active January 29, 2026 03:53
Utility to determine whether an HTTP response status code indicates a transient error that can be retried
const RETRYABLE_HTTP_STATUS_CODES = new Set([
408, 425, 429, 500, 502, 503, 504,
]);
/**
* Determines whether an HTTP response status code indicates a transient error that can be retried.
*
* @returns A boolean indicating whether the status code indicates a transient error.
*/
export const isRetryableHttpStatusCode = (code: number): boolean => {
@chalkygames123
chalkygames123 / left_command_pressed_alone_to_japanese_eisuu_and_right_command_pressed_alone_to_japanese_kana.json
Last active July 11, 2025 16:06
Minimal Karabiner-Elements rule for selecting the input source between Japanese Eisu or Kana with command keys in the US keyboard layout.
{
"description": "Change left_command/right_command pressed alone to japanese_eisuu/japanese_kana, respectively.",
"manipulators": [
{
"from": {
"key_code": "left_command",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_command" }],
"to_if_alone": [{ "key_code": "japanese_eisuu" }],
@chalkygames123
chalkygames123 / conventional-commits-regexp.txt
Last active October 21, 2025 23:46
Regexp matching Conventional Commits for a metadata restriction
^(?<type>build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?<scope>\([\w\-]+(?:[,\/\\] [\w\-]+)*\))?!?:
import plugin from 'tailwindcss/plugin';
/**
* 参照: https://piccalil.li/tutorial/create-a-responsive-grid-layout-with-no-media-queries-using-css-grid/
*/
const autoGrid = plugin(
({ addComponents, matchComponents, theme }) => {
matchComponents(
{
'auto-grid': (value) => ({
'use strict';
// 参照: https://tama-san.com/resolve-kanji/
const table = {
'⺃': '乚',
'⺅': '亻',
'⺇': '𠘨',
'⺉': '刂',
'⺋': '㔾',
'⺍': '𭕄',
javascript:(function () { const load = async () => { await new Promise((resolve, reject) => { const button = document.querySelector('.ajax-pagination-btn'); if (!button) { reject(); return; } button.click(); (function loop() { if (button.disabled) { setTimeout(loop, 200); } else { resolve(); } })(); }); }; document.scrollingElement.scrollIntoView(false); (function loop() { load().then(() => { loop(); }).catch(() => { for (const el of document.querySelectorAll('#dashboard .js-details-target')) el.ariaExpanded === 'false' && el.click(); }).finally(() => { document.scrollingElement.scrollIntoView(false); }); })(); })();
@chalkygames123
chalkygames123 / chatwork-mark-all-messages-as-read.js
Last active December 6, 2022 09:26
Chatwork: メッセージをすべて既読にする
javascript: (function () {const settingsButton = document.querySelector('[data-testid="room-header_room-settings-button"]',);const unreadRooms = document.querySelectorAll('#RoomList [role="listitem"]:has(._unreadBadge)',);let currentUnreadRoomIndex = 0;const handleHashChange = () => {settingsButton.click();Array.from(document.querySelector('[role="menu"]').children).find((item) => item.textContent.includes('メッセージをすべて既読にする')).click();if (currentUnreadRoomIndex < unreadRooms.length) {unreadRooms[currentUnreadRoomIndex].click();currentUnreadRoomIndex += 1;} else {window.removeEventListener('hashchange', handleHashChange);}};window.addEventListener('hashchange', handleHashChange);handleHashChange();})();
@chalkygames123
chalkygames123 / renovate.gitlab-ci.yml
Created August 8, 2022 12:08
Minimal config for running Renovate CLI with GitLab CI/CD's scheduled pipelines
stages:
- main
renovate:
stage: main
image: node:alpine
variables:
RENOVATE_PLATFORM: gitlab
RENOVATE_ENDPOINT: https://gitlab.example.com/api/v4
RENOVATE_TOKEN: $RENOVATE_TOKEN