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
  • Hedonic Treadmill, Japan
  • 21:10 (UTC +09:00)
View GitHub Profile
@chalkygames123
chalkygames123 / command_at_to_backtick.json
Created September 16, 2024 07:14
Minimal Karabiner-Elements rules for moving focus to the next/previous window in the JIS keyboard layout.
{
"description": "Change ⌘@/⌘⇧@ to ⌘`/⌘⇧`, respectively.",
"manipulators": [
{
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": ["command"],
"optional": ["any"]
}
@chalkygames123
chalkygames123 / command_to_japanese_input_switch.json
Last active September 16, 2024 07:14
Minimal Karabiner-Elements rules for switching input sources between Japanese Eisuu and Kana with command keys in the US keyboard layout.
{
"description": "Change left_command/right_command to japanese_eisuu/japanese_kana, respectively. (Post left_command/right_command if pressed alone)",
"manipulators": [
{
"from": {
"key_code": "left_command",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_command" }],
"to_if_alone": [{ "key_code": "japanese_eisuu" }],
@chalkygames123
chalkygames123 / gist:b7f300967364de8489eaa5197029004c
Created April 4, 2024 01:55
Regexp matching Conventional Commits with additional "deps" type for a metadata restriction
^(?<type>build|chore|ci|deps|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
@chalkygames123
chalkygames123 / prepare-commit-msg.git-notify
Last active August 14, 2022 08:42
Git hook for appending "git-notify:" to the commit message when specific files are changed
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
COMMIT_MSG_FILE=$1
STAGED_FILES=$(git diff --cached --name-only)
PATTERN='package-lock.json'
MESSAGE='Please rerun `npm install`'
if echo "$STAGED_FILES" | grep --quiet --line-regexp --max-count 1 "$PATTERN"; then
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style>
#container {
height: 100px;
background-color: #ccc;
transition: height 0.5s;