Skip to content

Instantly share code, notes, and snippets.

View Jessidhia's full-sized avatar

Jessica Franco Jessidhia

  • @pixiv Inc, pixiv desktop
  • Tokyo, Japan
View GitHub Profile
// @ts-check
// ==UserScript==
// @name PayPay Bank CSV Export
// @match https://login.paypay-bank.co.jp/wctx/*
// @match https://login.japannetbank.co.jp/wctx/*
// @icon https://login.paypay-bank.co.jp/favicon.ico
// @grant GM.setValue
// @grant GM.getValue
// @noframes
// @updateURL https://gist.github.com/Jessidhia/fbf19804e1ce2949a70aa36561930da7/raw/jnb.user.js
@Jessidhia
Jessidhia / useSelector.js
Last active July 18, 2023 15:31
useSelector refactoring
function useSelectorWithStoreAndSubscription(
selector,
equalityFn,
store,
contextSub
) {
const subscription = useMemo(() => new Subscription(store, contextSub), [
store,
contextSub
])
@Jessidhia
Jessidhia / super-deprecate.ts
Created June 10, 2019 01:05
Trivial webpack plugin / inline function to fail build if something is imported
/**
* Put in webpack's resolve.plugins[], direct reference.
* For example, `resolve: { plugins: [superDeprecate] }`.
*
*/
function superDeprecate(this: any) {
// request is the module name as written in the "import" declaration/expression / "require" call
// issuer is the absolute path to the file making the request
// I don't remember what path is
interface ResolveQuery {
@Jessidhia
Jessidhia / react-scheduler.md
Last active March 1, 2024 13:51
Implementation notes on react's scheduling model as of (shortly before) 16.8.0

Implementation notes on react's scheduling model as of (shortly before) 16.8.0

While the public API intended for users to use is the scheduler package, the reconciler currently does not use scheduler's priority classes internally.

ReactFiberScheduler has its own internal "mini-scheduler" that uses the scheduler package indirectly for its deadline-capable scheduleCallback.

This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.

// @ts-check
// ==UserScript==
// @name Export Suica transactions to CSV
// @namespace http://tampermonkey.net/
// @version 0.2
// @icon https://www.jreast.co.jp/favicon.ico
// @description Export Suica transactions to CSV
// @updateURL https://gist.github.com/Jessidhia/dc117754ec668421eadb60532646a0a7/raw/suica-script.user.js
// @author Jessidhia
// @include https://www.mobilesuica.com/iq/ir/SuicaDisp.aspx*
// A simplified replacement for react-router-redux
// that works with react-redux@^6 and with react-router@^4.4
// Uses hooks, so requires react@^16.7
import {
Action as LocationAction,
History,
Location,
LocationDescriptor,
LocationDescriptorObject,
@Jessidhia
Jessidhia / mui-styled.tsx
Last active November 3, 2018 06:23
TypeScript implementation of a styled-components-like API for material-ui's withStyles
import React from 'react'
import {
withStyles,
Theme,
StyledComponentProps,
} from '@material-ui/core/styles'
import cx from 'classnames'
import {
WithStylesOptions,
CSSProperties,
import Discord from 'discord.js'
const messageConfig: Map<string, EmojiRoleMap> = new Map([
// ['messageId', Map<'emoji id', 'role name'>]
[
'468309475808509955',
new Map<string, string>([
// TO-CHECK: discord.js v12 might drop the emoji name from the identifier
// ['emoji id', 'role name']
// this order is the same as the order in https://jp.finalfantasyxiv.com/jobguide/battle/
@Jessidhia
Jessidhia / b.mjs
Last active February 7, 2018 08:52
import * as index './index.mjs'
export function calculate () {
return index.calculate()
}
@Jessidhia
Jessidhia / .babelrc.js
Created November 4, 2017 07:54
Hack for testing the ESM hook
module.exports = {
presets: ['@babel/react']
}