Skip to content

Instantly share code, notes, and snippets.

Jessica Franco Jessidhia

Block or report user

Report or block Jessidhia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Jessidhia / super-deprecate.ts
Created Jun 10, 2019
Trivial webpack plugin / inline function to fail build if something is imported
View super-deprecate.ts
* 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 /
Last active Nov 8, 2019
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.

View suica-script.user.js
// @ts-check
// ==UserScript==
// @name Export Suica transactions to CSV
// @namespace
// @version 0.1
// @description Export Suica transactions to CSV
// @updateURL
// @author Jessidhia
// @include*
// @grant none
View connected-react-router.tsx
// 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,
Jessidhia / mui-styled.tsx
Last active Nov 3, 2018
TypeScript implementation of a styled-components-like API for material-ui's withStyles
View mui-styled.tsx
import React from 'react'
import {
} from '@material-ui/core/styles'
import cx from 'classnames'
import {
View roleBot.ts
import Discord from 'discord.js'
const messageConfig: Map<string, EmojiRoleMap> = new Map([
// ['messageId', Map<'emoji id', 'role name'>]
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
View b.mjs
import * as index './index.mjs'
export function calculate () {
return index.calculate()
Jessidhia / .babelrc.js
Created Nov 4, 2017
Hack for testing the ESM hook
View .babelrc.js
module.exports = {
presets: ['@babel/react']
View esm-example.js
// // given
// import foo from "bar"
// export let a
// export { a as b }
// export function hoisted() {}
// export {readFile} from "fs"
// export * from "path"
// console.log(foo)
Jessidhia / webpack.config.snippet.js
Created Nov 4, 2016
CommonsChunkPlugin setting to make a sync common chunk of async child chunks
View webpack.config.snippet.js
// having `entry: { main: path.resolve('src') }`:
new webpack.optimize.CommonsChunkPlugin({
name: 'common',
chunks: ['main'],
// "children" does not actually select all the children of "chunks",
// but completely ignores all "chunks" and selects the children of "name"
// instead, so it's useless for our use case, as we're making a new chunk.
minChunks: (() => {
const tag = `${__filename}-common-minChunks`
// the count argument will always be "1" as there's only one chunk in
You can’t perform that action at this time.