Skip to content

Instantly share code, notes, and snippets.

@ZachHaber
ZachHaber / bitburnerUtils.ts
Created January 14, 2024 18:18
Bitburner autocomplete
/**
* `createFlagSchema` will use the schema passed in for type definitio
* as well as creating an autocomplete functi
* and a minor validation setup for using flags
* @param flagSchema The schema object for the flags, the output type of the `flags` function return is based on this
* @param args The default arguments outside the flags
* @returns
* @example
* ```ts
* const flagSchema = createFlagSchema(
@ZachHaber
ZachHaber / VisGraph.tsx
Created April 15, 2021 21:00
Re write of https://github.com/crubier/react-graph-vis to a function component for strict mode compliance
import React, {
forwardRef,
HTMLAttributes,
useEffect,
useImperativeHandle,
useRef,
useState,
} from 'react';
import { DataSet } from 'vis-data';
import {
@ZachHaber
ZachHaber / Usage.tsx
Last active February 4, 2021 06:00
Field Wrappers for React-hook-form and Semantic UI React
import { Controller, useForm } from 'react-hook-form';
import { Form, Button, Checkbox } from 'semantic-ui-react';
import WField from './WField';
export function Usage() {
const { handleSubmit, control, errors } = useForm<{
input: string;
checkbox: boolean;
textarea: string;
select: string;