Skip to content

Instantly share code, notes, and snippets.

View bmingles's full-sized avatar

Brian Ingles bmingles

View GitHub Profile
@bmingles
bmingles / dh.sh
Created February 4, 2025 20:01
Deephaven Docker with SSL
# Run docker compose using local certs
port=444
auth="-DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler"
start_opts="$auth -Dhttp.port=$port -Dssl.identity.type=privatekey -Dssl.identity.certChainPath=/dev-certs/$certname.crt -Dssl.identity.privateKeyPath=/dev-certs/$certname.key"
DEEPHAVEN_PORT=$port START_OPTS=$start_opts docker compose up "$@"
@bmingles
bmingles / gh-prs.py
Last active November 22, 2024 17:17
Deephaven GH / Jira Board
# Map community web ui release versions to enterprise PRs. Useful for updating enterprise version logs.
# Inspired by https://medium.com/@deephavendatalabs/leverage-githubs-awesome-rest-api-f7d34894765b
#
# The script requires some env variables containing username + access tokens for Github + JIRA
# 1. Set env variables in your local environment
# - GH_USERNAME - Your github username
# - GH_TOKEN - In Github, create a read-only fine-grained token:
# https://github.com/settings/tokens?type=beta
# - JIRA_USERNAME - Your JIRA username (likely your illumon email address)
# - JIRA_TOKEN - In JIRA, create api access token:
@bmingles
bmingles / index.mjs
Last active October 30, 2024 14:51
KeyGen
#!/usr/bin/env node
// Experiment with generating a key pair, uploading the public key to the server,
// and authenticating with the private key.
import {
generateBase64KeyPair,
loginClientWithKeyPair,
uploadPublicKey,
} from '@deephaven-enterprise/auth-nodejs'
import { loginPrompt } from './loginPrompt.mjs'
# Seems simpler / better
https://security.stackexchange.com/a/183973
https://stackoverflow.com/a/43665244/20489
@bmingles
bmingles / git-worktree.sh
Last active September 21, 2024 03:44
Git Worktree
git clone --bare <repo_url> .bare
echo "gitdir: ./.bare" > .git
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
@bmingles
bmingles / MyComponent.tsx
Last active October 5, 2022 01:31
MobX with custom React context hook
import React from 'react'
import { observer } from 'mobx-react-lite'
const MyComponent: React.FC = () => {
const { name, age, loadAge, loadName } = useSomeService()
React.useEffect(() => {
loadAge()
void loadName()
}, [loadName])
@bmingles
bmingles / settings.json
Created September 5, 2022 18:48
vscode custom colors
{
"workbench.colorCustomizations": {
"statusBar.background": "#ce6f03",
"titleBar.activeBackground": "#ce6f03"
}
}
@bmingles
bmingles / preview.js
Last active February 17, 2022 22:24
Storybook - Custom Story Sorting
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
options: {
storySort,
},
}
/** Force example stories to sort last */
function forceExampleLast(id) {
return (id.startsWith('example-') ? '' : '_') + id
@bmingles
bmingles / MyComponent.tsx
Last active January 9, 2022 23:44
Example of using Mobx + React
import React from 'react'
import { observer } from 'mobx-react-lite'
const MyComponent: React.FC = () => {
// I would typically get this from context API with custom hook instead of local useMemo
// e.g. const { name, age, loadAge, loadName } = useSomeService()
const { age, name, loadAge, loadName } = React.useMemo(() => new SomeService(), [])
React.useEffect(() => {
loadAge()
@bmingles
bmingles / Startup script
Last active November 28, 2021 21:35
Azure App Service Config
# Configuration -> General Settings -> Startup Command
pm2 serve /home/site/wwwroot/ --no-daemon --spa