Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph McCormick esmevane

View GitHub Profile
@esmevane
esmevane / disco_v5_plus_Win_Install.md
Created Jan 24, 2023 — forked from MSFTserver/disco_v5_plus_Win_Install.md
guide to installing disco v5+ locally on windows
View disco_v5_plus_Win_Install.md

Install Disco Diffusion v5 for Windows

NOTE: Pytorch3d no longer has to be compiled i have stripped out the function we use to make this a lot easier and also so we do not have to use WSL2 with linux and can now run directly on your windows system.

Comments section is not checked often for issues please join the disco diffusion discord for assistance

https://discord.gg/mK4AneuycS

You may now use the official disco diffusion notebook with this tutorial as it has been uodated to reflect the changes here for better cross platform support

@esmevane
esmevane / create-user.spec.tsx
Last active Oct 14, 2021
[ Typescript / React / Testing Library ]: Going through the create user kata
View create-user.spec.tsx
import { render } from '@testing-library/react';
import userEvents from '@testing-library/user-event';
import { useState } from 'react';
function usePassword() {
const [password, setPassword] = useState('');
const [show, setShow] = useState(false);
const toggle = () => setShow((previousShowValue) => !previousShowValue);
const update = (event: React.ChangeEvent<HTMLInputElement>) =>
@esmevane
esmevane / paths.ts
Last active Sep 13, 2021
[ Typescript ]: Strongly typed, filterable keypaths
View paths.ts
type GetKeypaths<
GivenType,
Filter extends string = '___!!!PLACEHOLDER!!!___'
> = GivenType extends object
? keyof GivenType extends string
? keyof GivenType extends Filter
? GetKeypaths<GivenType[keyof GivenType], Filter>
:
| keyof GivenType
| `${keyof GivenType}.${GetKeypaths<
View SketchSystems.spec
App
Checking Credentials
Identity Present -> Home Page
Identity Absent -> Registration
Registration
Check for Identity Info
Identity Info Present -> Registration Credentials Form
Identity Info Absent -> Identity Info Form
Identity Info Form
Input Identity Info -> Validating Identity Info
@esmevane
esmevane / toggle.spec.tsx
Created Jul 28, 2021
[ React / Typescript ]: Example of an architectural journey with a React Toggle component
View toggle.spec.tsx
/* eslint-disable @typescript-eslint/require-await */
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { createContext, useContext, useReducer } from 'react';
type Events = { type: 'toggle' } | { type: 'reset' };
interface EventMap {
toggle: () => void;
reset: () => void;
}
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View SketchSystems.spec
Touchpoint Dashboard
Loading
Success -> Authenticating
Failure -> Unable to Load
Unable to Load
Retry -> Loading
Authenticating
Checking Credentials
No Credentials -> Login
Credentials Exist -> Verify Credentials
@esmevane
esmevane / SketchSystems.spec
Last active Oct 11, 2020
Touchpoint Dashboard
View SketchSystems.spec
Touchpoint Dashboard
Loading*
Success -> Authenticating
Failure -> Unable to Load
Unable to Load
Retry -> Loading
Authenticating
Checking Credentials?
No Credentials -> Login
Credentials Exist -> Authenticate
View SketchSystems.spec
Widget&
Async
Pending
Fetch -> Fetching
Fetching
Resolved -> Success
Rejected -> Failure
Success
Fetch -> Fetching
Failure
@esmevane
esmevane / App.test.tsx
Created Jun 2, 2020
[ Typescript / React ]: Login kata 06-02-2020
View App.test.tsx
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import App, { AppContext } from './App';
const SpiesOnApp = () => {
const context = React.useContext(AppContext);
return <>{JSON.stringify(context)}</>;
};
test('tracks username', async () => {