Skip to content

Instantly share code, notes, and snippets.

kachar / generateAzureImage.tsx
Created January 30, 2024 15:39
Dalee-3 Azure image geneation
import type { ImagesResponse } from 'openai/resources/images.mjs'
import type { AzureOpenAIInput, OpenAIChatInput } from '@langchain/openai'
import { typedFetch } from '@/server/utils/fetch.utils'
export const generateAzureImage = async ({
}: {
kachar / switch.tsx
Created January 27, 2024 06:48
shadcn switch with different sizes
'use client'
import type { VariantProps } from 'class-variance-authority'
import * as React from 'react'
import * as SwitchPrimitives from '@radix-ui/react-switch'
import { cva } from 'class-variance-authority'
import { cn } from '@/lib/utils'
const switchVariants = cva(
kachar /
Last active October 29, 2023 16:10
Profile Readme

GitHub Streak

import { Dispatch, SetStateAction, useState } from 'react'
export default function useLocalStorage<T>(
key: string,
initialValue: T,
): [T, Dispatch<SetStateAction<T>>] {
// State to store our value
// Pass initial state function to useState so logic is only executed once
const [storedValue, setStoredValue] = useState<T>(() => {
if (typeof window === 'undefined') {
kachar / gist:62e91c90a8cce7c6a0877b9563c5834b
Created June 9, 2022 09:39
find lines of code in a repo and sort them desc
wc -l $(git ls-files services/webapp/**/*.js ) | sort -n
kachar /
Created April 25, 2022 18:08 — forked from etam/
Git-crypt remove user.
#!/usr/bin/env bash
# Script to remove GPG user (recipient) with git-crypt
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.

After the March update 1.55.0 of VSCode I've experienced a misconfiguration in golang extension

Failed to run '/snap/bin/go env. The config change may not be applied correctly.

Golang is installed locally via snap so I had to change the following paths in vscode settings.json

go env GOPATH
go env GOROOT
# sudo snap install task --classic
version: "3"
ps: docker-compose ps
up: docker-compose up -d {{- .SERVICE}}
kachar /
Last active February 19, 2021 08:59


<WizardProvider steps={4}>
  <Container maxWidth="sm">
    <Paper className={classes.paper}>
      <WizardSlotForm />