Skip to content

Instantly share code, notes, and snippets.

View hiz8's full-sized avatar

iji hiz8

View GitHub Profile
@steipete
steipete / windsurf-auto-continue.js
Last active August 22, 2025 03:30
Windsurf Auto Continue press button JS. Windsurf Menu Help -> Toggle Developer Tools -> Paste into Console.
// Windsurf Auto Press Continue v13.2 (with added logging)
(() => {
const SCRIPT_NAME = 'Windsurf Auto Press Continue v13.2 (logged)'; // Updated name for clarity
let intervalId = null, lastClick = 0;
// --- Config ---
const BTN_SELECTORS = 'span[class*="bg-ide-button-secondary-background"]';
const BTN_TEXT_STARTS_WITH = 'continue';
const SIDEBAR_SELECTOR = null;
const COOLDOWN_MS = 3000;
@wilsonpage
wilsonpage / swr.ts
Last active March 28, 2025 09:35
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
@startuml
UA -> App: /login
UA <-- App: Redirect
UA -> 認可サーバー: /auhorize
UA <- 認可サーバー: ログインページ表示
UA -> 認可サーバー: ログイン
UA <- 認可サーバー: 認可(AppにXXXを許可しますか?
UA -> 認可サーバー: OK
UA <-- 認可サーバー: Redierct
UA -> App: /callback?code=xxx&state=xxx
@Grsmto
Grsmto / react-table.d.ts
Created March 6, 2019 12:59
React Table v7 TS typings definition
// Type definitions for react-table 7
// Project: https://github.com/tannerlinsley/react-table#readme
// Definitions by: Grsmto <https://github.com/grsmto>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
declare module 'react-table' {
export type Cell = {
render: (type: string) => any;
getCellProps: () => any;
column: Column;

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@sebmarkbage
sebmarkbage / The Rules.md
Last active October 25, 2025 11:39
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@mangosmoothie
mangosmoothie / example.js
Last active May 28, 2022 08:37
redux-mock-store with redux-saga for testing actions / sagas
// https://github.com/arnaudbenard/redux-mock-store/issues/59#issuecomment-345741265
//------------- the saga ----------------
function* fetchSaga(action) {
try {
yield put({type: "FETCH_SUCCEEDED", data: "data"});
} catch (e) {
yield put({type: "FETCH_FAILED", message: e.message});
}
}
@remy
remy / ActiveLink.js
Last active May 3, 2025 03:03
Next.js version of `activeClassName` support.
@Huruikagi
Huruikagi / karma.conf.ts
Last active June 28, 2021 09:46
TypeScript+Jasmine+Karma+webpackとかの設定
// ここからコンパイル型情報の調整用スクリプト
import * as karma from "karma";
import * as karmaCoverage from "karma-coverage";
import * as webpack from "webpack";
// @types/karma-webpackはなかったのでここで作成
// webpack用のオプションを設定できるようにする
namespace karmaWebpack {
export interface ConfigOptions extends karma.ConfigOptions {
webpack: webpack.Configuration;
@newcloudtech
newcloudtech / karma.config.js
Last active June 15, 2021 04:00
Webpack and karma configs
var webpackConfig = require('../webpack.config.js');
module.exports = function () {
autoWatch: true,
frameworks: ['jasmine'],
preprocessors: {
'../app/**/*.js': ['webpack'],
'../app/**/scripts/**/*.js': ['coverage']
},
webpack: {
resolve: webpackConfig.resolve,