Skip to content

Instantly share code, notes, and snippets.

View sadeghbarati's full-sized avatar
🍉

Sadegh Barati sadeghbarati

🍉
  • Iran, Mashhad
  • 09:58 (UTC +03:30)
View GitHub Profile
@lanzclintonv
lanzclintonv / date-picker.tsx
Last active April 14, 2025 11:28
Shadcn Zag Datepicker
"use client";
import { useId } from "react";
import * as datepicker from "@zag-js/date-picker";
import { useMachine, normalizeProps } from "@zag-js/react";
import { X, ChevronLeft, CalendarIcon, ChevronRight } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import {
ComboboxInput,
ComboboxRoot,
useFilter,
} from "reka-ui";
import { Icon } from "@iconify/vue";
const { contains } = useFilter({ sensitivity: "base" });

Volar 2.0 "Link"

I am Johnson, the author of Volar (now known as Vue Language Tools), and we released version 2.0 in March this year. This article will introduce you to the improvements and development experiences brought by 2.0.

Why 2.0?

In Vetur and Volar v1, we implemented Vue's IDE support through the Language Server Protocol (LSP), which works well for most small to medium-sized Vue projects, but there may be problems for very large projects.

TS Server and Vue Language Server are using double the memory

import ReactSelect from 'react-select'
export const REACT_SELECT_CUSTOM_STYLES = {
control: (provided) => ({
...provided,
fontSize: '0.875rem',
lineHeight: '1.25rem'
}),
valueContainer: (provided) => ({
...provided,
@nicostombros
nicostombros / data-table.tsx
Last active March 22, 2025 07:35
Shadcn UI implementation of DataTable and Pagination components working together
// same as your regular shadcn datatable implementation (which uses tanstack table)
// note that the shadcn datatable uses shadcn table for the ui. see https://ui.shadcn.com/docs/components/data-table
import {
ColumnFiltersState,
SortingState,
VisibilityState,
flexRender,
getCoreRowModel,
getFilteredRowModel,
@yyx990803
yyx990803 / 3.4.md
Last active December 29, 2023 16:42
[DRAFT] Vue 3.4 aggregated changelog

[DRAFT] 3.4.0 Aggregated Changelog

This is the aggregated changelog for 3.4 that includes changes landed in all alpha and beta pre-releases. For changelog of individual pre-releases, please check here.

Features

@jsonbytes
jsonbytes / gist:d4a8b59a7de68507dab42a9544564f26
Created December 4, 2023 13:37
General purpose API Client
import axios, {
AxiosError,
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
InternalAxiosRequestConfig,
} from "axios";
import { API_BASE_URI } from "../config/apiConfig";
import { ErrorResponse, FetchResponse } from "@sapience/common";
@webfansplz
webfansplz / Introducing Vue DevTools (Vite Plugin).md
Last active January 1, 2024 12:32
Introducing Vue DevTools (Vite Plugin)

Introduction:

In recent years, there has been an increasing focus on improving the developer experience (DX). Tools and frameworks have been striving to enhance it. I believe everyone already knows Vite, a tool that has gained significant popularity in the frontend build tooling in recent years. It's fast, but that's not its only advantage.Vite's ecosystem has seen rapid growth due to its user-friendly and highly extensible plugin design mechanism.This allows developers to quickly integrate Vite into their tools and frameworks. Anthony Fu opensourced the Nuxt DevTools on Vue Amsterdam 2023,a new tool to help you understand your Nuxt app and improve the developer experience even further. It deeply moved and inspired me, why can't Vue have a similarly cool tool? We all know that there is an official Vue Devtools browser extension, but can we create a Vue Devtools that is bound to Vite an

@alexanderson1993
alexanderson1993 / AlertDialogProvider.tsx
Created April 2, 2023 19:07
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components.
"use client";
import * as React from "react";
import { Input } from "@/components/ui/Input";
import { Button } from "@/components/ui/Button";
import {
AlertDialog,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
import { useCalendar } from '@h6s/calendar';
import { useMachine } from '@xstate/react';
import { Button as AriaButton } from 'ariakit/button';
import clsx from 'clsx';
import { isSunday, isSameDay, addMonths, isFuture, isPast, setDate } from 'date-fns';
import format from 'date-fns/format';
import isWithinInterval from 'date-fns/isWithinInterval';
import { FC, useCallback, useMemo } from 'react';
import Select from '@components/forms/components/Select';