Skip to content

Instantly share code, notes, and snippets.

@ggascoigne
ggascoigne / GraphiqlSchemaReloading.tsx
Created July 28, 2021 21:20
GraphiQl editor with Schema Reloading - also uses GraphiqlExplorer
import 'graphiql/graphiql.css'
import { Trans, t } from '@lingui/macro'
import {
InputLabel,
MenuItem,
Select,
createStyles,
makeStyles,
} from '@material-ui/core'
@ggascoigne
ggascoigne / mui-text-field-a11y.js
Last active January 24, 2021 18:24
eslint rule to ensure that formik Field elements contain an id for associated labels.
/* eslint-disable @typescript-eslint/no-var-requires */
const { hasProp, getProp, getPropValue, elementType } = require('jsx-ast-utils')
/**
* @typedef { import("@types/eslint").RuleContext }
* @typedef { import("@types/eslint").RuleListener }
* @typedef { import("@types/eslint").ASTNode }
*/
// eslint rule to ensure that Material UI TextField components have an id for associated labels.
@ggascoigne
ggascoigne / audit.js
Created January 14, 2020 21:37
Allow exclusion of yarn audit failures.
// Run a vulnerability audit with some retry logic for if the audit
// service is temporarily down (which we have seen sometimes in jenkins builds)
/* eslint-disable @typescript-eslint/no-var-requires */
require('perish')
const execa = require('execa')
const path = require('path')
const fs = require('fs')
const promiseRetry = require('promise-retry')
const PROJECT_ROOT_DIRNAME = path.resolve(__dirname, '..')
@ggascoigne
ggascoigne / react-table.d.ts
Created December 3, 2019 03:29
Typescript definitions for react-table 7.0.0-beta.23
// TypeScript Version: 3.5
// reflects react-table@7.0.0-beta.23
// note that if you are using this you might well want to investigate the use of
// patch-package to delete the index.d.ts file in the react-table package
declare module 'react-table' {
import {
ComponentType,
DependencyList,
2017-03-06 11:04:37.939 ERROR --- [ main] o.s.boot.SpringApplication : Application startup failed
java.lang.NullPointerException: null
at org.hibernate.engine.internal.StatefulPersistenceContext.addEntity(StatefulPersistenceContext.java:468)
at org.hibernate.action.internal.AbstractEntityInsertAction.makeEntityManaged(AbstractEntityInsertAction.java:126)
at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:279)
at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:254)
at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:299)
at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:318)
at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:275)
@ggascoigne
ggascoigne / gist:c14f135b6d7c42ef4d2f
Created December 23, 2015 20:56
Seiki Settings
The most important setting to enable computer usage is to change "Sharpness" to 0.
Otherwise, the rest is likely a matter of personal preference.
Picture
Mode: User
Contrast: 45
Brightness: 55
Color: 39
#!/bin/bash
#
# Purpose: manually associate missed renames in merge conflicts
#
# Usage: git merge-associate <our-target> <base> <theirs>
#
# Example: After a failed rename detection A/a -> B/b which results
# in CONFLICT (delete/modify) for A/a and corresponding "deleted by us"
# messages in git status, the following invocation can be used to manually
# establish the link: