Skip to content

Instantly share code, notes, and snippets.

View magick93's full-sized avatar
💩
Focusing

magick93

💩
Focusing
View GitHub Profile
@magick93
magick93 / xstate_invoke.ts
Last active April 16, 2024 01:16
xstate invoke
import { assign, setup } from 'xstate';
function executeAction() {
console.log('executing action');
}
export type ConfirmationDialogMachineEvent =
| { type: 'OPEN_DIALOG'; action: void }
| { type: 'CONFIRM' }
| { type: 'CANCEL' };
@magick93
magick93 / ConfirmDeleteFSM.ts
Created April 15, 2024 22:15
Confirm delete FSM
import { assign, createMachine, fromPromise } from 'xstate';
import { setup } from 'xstate';
function executeAction() {
console.log('FSM: Executing action...');
};
export interface ConfirmationDialogMachineContext {
@magick93
magick93 / radiobuttongroup.svelte
Last active November 16, 2023 21:12
Re-creating Tailwind color radiobuttons
<script lang="ts">
import { createRadioGroup, melt } from '@melt-ui/svelte';
const {
elements: { root, item, hiddenInput },
helpers: { isChecked },
} = createRadioGroup({
defaultValue: 'default',
});
@magick93
magick93 / troublesome.sql
Created September 29, 2023 19:58
Error: 'character varying' cannot be found in EnumType's name.
-- DROP SCHEMA public;
CREATE SCHEMA public AUTHORIZATION pg_database_owner;
COMMENT ON SCHEMA public IS 'standard public schema';
-- DROP TYPE public."account_based_product_code_list_type";
CREATE TYPE public."account_based_product_code_list_type" AS ENUM (
'HSA',
Kanel
[
'supabase_migrations', '_analytics',
'_realtime', 'nzlegal',
'adls', 'vault',
'stripe', 'private',
'auth', 'extensions',
'graphql_public', 'net',
'public', 'realtime',
'storage', 'supabase_functions',
{
"version": "4.3.0",
"title": "PublicationType",
"description": "Basic type that contains all properties common to publication, which could be print or electronic.",
"type": "object",
"properties": {
"id": {
"description": "An identifier of the publication.",
"$schema": "http://json-schema.org/draft-04/schema#",
"version": "4.3.0",
@magick93
magick93 / PublicationType.json.cue
Created March 21, 2023 07:11
Cue from dereferenced json
version: "4.3.0"
title: "PublicationType"
description: "Basic type that contains all properties common to publication, which could be print or electronic."
type: "object"
properties: {
id: {
name: "id"
description: "An identifier of the publication."
$schema: "http://json-schema.org/draft-04/schema#"
version: "4.3.0"
@magick93
magick93 / OpenAPI
Created January 28, 2021 01:13
OpenAPI that caused error
openapi: 3.0.0
info:
title: NZDAX
version: 2.4.0
contact:
name: Adroit
url: 'https://adroit.ph/ccxt-rest-contact-us/'
email: [email protected]
license:
name: MIT
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.sample.myapp:sample >-----------------------
[INFO] Building Sample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.2.5.RELEASE:run (default-cli) > test-compile @ sample >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (default-resources) @ sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
@magick93
magick93 / keybase.md
Last active September 13, 2019 08:23

Keybase proof

I hereby claim:

  • I am magick93 on github.
  • I am magick93 (https://keybase.io/magick93) on keybase.
  • I have a public key ASC6lz4yIkL55VRZPNz32r2_t-ZN7qe4CXFl95qz-JVN-Ao

To claim this, I am signing this object: