Skip to content

Instantly share code, notes, and snippets.

View anubra266's full-sized avatar
💥
Playing vscode...

Abraham anubra266

💥
Playing vscode...
View GitHub Profile
<!-- i have to warn you, this code SUCKS! i DO NOT recommend using this code, but you can if you want -->
<div style="width:calc(442px + 28px * 2); outline:1px solid #232323; border-radius:8px;position: absolute;top:0;left:0;translate:calc(50vw - 50%) calc(50vh - 50%); box-sizing: border-box;container-type: size;height:600px;contain:strict">
<div style="overflow: clip;contain:strict;width:100%;height:100%;position:absolute">
<div style="padding:28px;display: flex;height:100%;box-sizing:border-box;flex-direction: column;align-items: center;justify-content: center;">
<svg class="nv-block sm:nv-hidden nv-h-6 nv-w-auto" style="width:100px;margin-top:2px" viewBox="0 0 1230.574 519.774" xmlns="http://www.w3.org/2000/svg" aria-label="Cloudflare"><path d="m784.025 512.011 5.872-20.311c6.998-24.169 4.394-46.511-7.349-62.926-10.801-15.122-28.804-24.022-50.666-25.056l-414.114-5.281c-2.788-.147-5.096-1.403-6.518-3.471-1.44-2.123-1.773-4.856-.886-7.478 1.366-4.08 5.41-7.164 9.62-7.349l417.954-5.299c49.576-2.271 103.2
@anubra266
anubra266 / plan.md
Last active February 24, 2025 18:10
Zag JS Visualizer

Plan for the Zag JS v1 Visualizer

  1. StateNode Structure
    • initial: Points to the initial child StateNode
    • transitions: Includes eventType, cond | condition | guard, actions, and a short description
    • id, key: Identifiers for the node string
    • states: An array of children StateNode[]
    • order: A numeric indicator (e.g. 1, 2, 3), likely matching the definition order
    • description: A brief explanation of the node’s role optional string
  • definition: References to invoke, entry, and exit actions Record&lt;'name' | 'id', string&gt;
@anubra266
anubra266 / fuzz-search.js
Created October 18, 2024 14:38
fuxxy search
class Search {
constructor(list, options = {}) {
this.list = list;
this.options = {
isCaseSensitive: options.isCaseSensitive || false,
includeScore: options.includeScore || false,
shouldSort: options.shouldSort || true,
includeMatches: options.includeMatches || false,
minMatchCharLength: options.minMatchCharLength || 1,
threshold: options.threshold || 0.6,
@anubra266
anubra266 / guide.md
Created May 29, 2024 04:53
Svelte toast with events
<!-- 1. Create the single toast -->
<script lang="ts">
  import { normalizeProps, useActor } from "@zag-js/svelte"
  import * as toast from "@zag-js/toast"

  interface Props {
    actor: toast.Service
  }
@anubra266
anubra266 / gist:2d40f3ede2bd9b8149458c9fec9dc990
Created February 22, 2022 00:24
Always open chakra UI drawer
https://github.com/chakra-ui/chakra-ui/issues/2893#issuecomment-780143150
@anubra266
anubra266 / favicon.md
Last active July 9, 2021 18:29
Themes svg favicons
<svg>
  <style>
    path { fill: black; }
    @media (prefers-color-scheme: dark) {
      path { fill: white; }
    }
  </style>

 
@anubra266
anubra266 / usage.md
Created June 15, 2021 08:41
tags input
function Usage() {
  const inputStyles = useMultiStyleConfig("Input", { size:'md', variant:'filled' }).field
  const tagStyles = useStyleConfig("InputGroup", { size: 'sm' })
  console.log(tagStyles)  
   
  return (
      <Wrap w="100%" tabIndex="1" __css={inputStyles} display="flex"  align="center" h="auto" py="2" >
      
         <Tag
@anubra266
anubra266 / Readme.md
Created June 2, 2021 00:26
Prevent Input loss of focus when clicking a menu item
$(document).on('mousedown', '#inputMenu li', function (e) {
    $('#input').val($(this).text());
    $('#inputMenu').removeClass('active');
    e.preventDefault();
    return false
});
  
$('#input').on('focusout',function(e) {
 $('#inputMenu').removeClass('active');

Get deps with

npx npm-remote-ls --flatten @chakra-ui/react -d false -o false

NB: Apostrophe must be double quotes

const deps = [
 "@chakra-ui/react@1.6.3",
https://codepen.io/denic/pen/GRoOxbM