Skip to content

Instantly share code, notes, and snippets.

View wbyoung's full-sized avatar

Whitney Young wbyoung

  • FadingRed
  • Portland, OR
View GitHub Profile
/* @flow */
import React, { type Element } from 'react';
import Relay from 'react-relay/classic';
class CreateListMutation extends Relay.Mutation {
static fragments = {
viewer: () => Relay.QL`
fragment on User {
id
@wbyoung
wbyoung / environment.js
Created July 23, 2018 17:59
Relay environment while exploring deferred queries
/* @flow */
import {
forOwn,
size,
get,
transform,
noop,
} from 'lodash';
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: managedcertificates.networking.gke.io
spec:
group: networking.gke.io
names:
kind: ManagedCertificate
plural: managedcertificates
shortNames:
#!/bin/bash
set -e
JQ="jq --raw-output --exit-status"
if [ -x "$(command -v kustomize)" ]; then
KUSTOMIZE="kustomize build"
else
KUSTOMIZE="kubectl kustomize"
@wbyoung
wbyoung / adaptive-lighting-adjust-while-off.yaml
Last active September 1, 2025 14:04
Adaptive Lighting Adjustments While Off
alias: Adjust Adaptive Lighting Controlled Lights While Off
mode: restart
triggers:
- trigger: time_pattern
minutes: /5
variables:
adjust_hue: true
adjust_inovelli: true
- trigger: state
entity_id: !include ../../entity_lists/adaptive-lighting.yaml
@wbyoung
wbyoung / psql-to-mmd-with-filter.sql
Last active February 6, 2026 17:54
Generate a Mermaid diagram from a PostgreSQL query
WITH target_tables AS (
SELECT DISTINCT(constr.relname)
FROM pg_class constr
JOIN pg_namespace nmsp ON nmsp.oid = constr.relnamespace
LEFT join pg_attribute attrs ON constr.oid = attrs.attrelid
AND attrs.attnum > 0
AND NOT attrs.attisdropped
LEFT JOIN pg_type t ON attrs.atttypid = t.oid
WHERE constr.relkind in ('r', 'p')
AND NOT constr.relispartition