This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function missing_fk_indexes () | |
returns table ( | |
referencing_table regclass, | |
fk_columns varchar, | |
table_size varchar, | |
fk_constraint name, | |
referenced_table regclass | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
CSSProperties, | |
MouseEvent, | |
useCallback, | |
useEffect, | |
useMemo, | |
useRef, | |
useState, | |
} from 'react' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ({ | |
size, | |
prompt, | |
settings, | |
numImages, | |
}: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wc -l $(git ls-files services/webapp/**/*.js ) | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/cilynx/rtl88x2bu.git | |
cd rtl88x2bu | |
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf) | |
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER} | |
sudo dkms add -m rtl88x2bu -v ${VER} | |
sudo dkms build -m rtl88x2bu -v ${VER} | |
sudo dkms install -m rtl88x2bu -v ${VER} | |
sudo modprobe 88x2bu | |
# Plug in the adapter in the USB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
NewerOlder