Skip to content

Instantly share code, notes, and snippets.

View ZanzyTHEbar's full-sized avatar
👨‍💻
Doing the codes

DaOfficialWizard ZanzyTHEbar

👨‍💻
Doing the codes
View GitHub Profile
#include <ESP8266WiFi.h> // Simple Libary for Wifi AP to use
const char WiFiAPPSK[] = "xxx"; // Set Wifi Password
const char AP_NameChar[] = "xxx"; // Set Wifi Name
#include <Hash.h> // Used for webserver
#include <ESPAsyncTCP.h> // Used for webserver
#include <ESPAsyncWebServer.h> // Used for webserver
#include <FS.h> // Used for webserver
AsyncWebServer server(80); // Create AsyncWebServer object on port 80
#include "StateManager.hpp"
StateManager<State_e> StateManager_Device;
StateManager<ButtonState_e> StateManager_Buttons;
StateManager<MotorState_e> StateManager_Motor;
@ZanzyTHEbar
ZanzyTHEbar / index.tsx
Created August 16, 2023 23:31
solid-dnd
import {
useDragDropContext,
DragDropProvider,
DragDropSensors,
DragOverlay,
SortableProvider,
createSortable,
closestCenter,
} from '@thisbeyond/solid-dnd'
import { For, JSXElement, createSignal } from 'solid-js'
@ZanzyTHEbar
ZanzyTHEbar / resizer.tsx
Last active April 28, 2024 19:17
Resizing Component in SolidJS
import { throttle } from '@solid-primitives/scheduled'
import {
splitProps,
createSignal,
createEffect,
onCleanup,
JSXElement,
type Component,
type ComponentProps,
children,
import { createDraggable, transformStyle } from '@thisbeyond/solid-dnd'
import { JSXElement, createSignal, type ParentComponent, onMount } from 'solid-js'
import { TabsTrigger } from '@components/ui/tabs'
import { UITab, useAppContextUI } from '@context/ui'
/* Handle Dockable using solid-dnd */
const activeTabClasses = [
'tab-active',
'drop-shadow-2xl',
@ZanzyTHEbar
ZanzyTHEbar / index.css
Last active January 5, 2024 20:48
Solid-UI tailwindcss
@layer base {
/* This style is REQUIRED due to how kobalte handles focus-visible state */
* {
@apply outline-none [&[data-focus-visible]]:outline-white;
}
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
@ZanzyTHEbar
ZanzyTHEbar / error.txt
Created February 11, 2024 19:32
Room Schema Error
Expected:
TableInfo{
name='airports',
columns={
longitudeDeg=Column{name='longitudeDeg', type='REAL', affinity='4', notNull=true, primaryKeyPosition=0, defaultValue='undefined'},
elevationFt=Column{name='elevationFt', type='REAL', affinity='4', notNull=false, primaryKeyPosition=0, defaultValue='undefined'},
continent=Column{name='continent', type='TEXT', affinity='2', notNull=true, primaryKeyPosition=0, defaultValue='undefined'},
isoRegion=Column{name='isoRegion', type='TEXT', affinity='2', notNull=true, primaryKeyPosition=0, defaultValue='undefined'},
gpsCode=Column{name='gpsCode', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='undefined'},
keywords=Column{name='keywords', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='undefined'},
@ZanzyTHEbar
ZanzyTHEbar / logger.hpp
Created March 12, 2024 16:16
Logger using variadic templating
#pragma once
#include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <utilities/helpers.hpp>
class Logger {
public:
@ZanzyTHEbar
ZanzyTHEbar / api.tsx
Last active April 15, 2024 17:22
tauri_local_http_plugin.rs
import { removeFile, readTextFile, BaseDirectory, writeTextFile } from '@tauri-apps/api/fs'
import { getClient, ResponseType } from '@tauri-apps/api/http'
import { appConfigDir, join } from '@tauri-apps/api/path'
import { invoke, convertFileSrc } from '@tauri-apps/api/tauri'
import { createContext, useContext, createMemo, Accessor, type ParentComponent } from 'solid-js'
import { createStore, produce } from 'solid-js/store'
import { debug, error, trace, warn } from 'tauri-plugin-log-api'
import { download, upload } from 'tauri-plugin-upload-api'
import { useAppDeviceContext } from './device'
import { useAppNotificationsContext } from './notifications'