Skip to content

Instantly share code, notes, and snippets.

View q1b's full-sized avatar
🎯
Focusing

Sukhpreet Singh q1b

🎯
Focusing
View GitHub Profile
import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { PanelLeftIcon } from "lucide-react";
import { useIsMobile } from "@/hooks/use-mobile";
import { cn } from "@/utils";
import { Button } from "@/components/ui/base-button";
import { Input } from "@/components/ui/base-input";
import { Separator } from "@/components/ui/base-separator";
import {
Sheet,
<script lang="ts">
let dialog: {
el: HTMLDialogElement | undefined;
open: () => void;
close: () => void;
loading: boolean;
} = $state({
el: undefined,
open: () => dialog.el?.showModal(),
close: () => dialog.el?.close(),
@q1b
q1b / Astro-icon-component.astro
Created February 10, 2023 13:43
Astro Icon Component Using *Iconify Icon* Public API, for my personal project
---
interface Props {
pack?: 'heroicons' | 'fluent';
name: string;
filled?: boolean;
mini?: boolean;
}
const { pack = 'fluent', name, filled, mini } = Astro.props;
@q1b
q1b / bubble_sort.go
Created December 10, 2022 12:14
Bubble Sort in Golang, from algo course
package main
import "fmt"
func swap(arr *[]int,in1 int,in2 int) {
temp := (*arr)[in2]
(*arr)[in2] = (*arr)[in1]
(*arr)[in1] = temp
}
@q1b
q1b / binary_search.go
Created December 10, 2022 11:45
Binary Search Implementation in GOlang, learning algo
package main
import (
"fmt"
)
func linearSearch(haystack []int,needle int) bool {
for _, i := range haystack {
if i == needle {
return true
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"os"
"strconv"
"strings"