Skip to content

Instantly share code, notes, and snippets.

View AVGVSTVS96's full-sized avatar

Bassim Shahidy AVGVSTVS96

View GitHub Profile
@AVGVSTVS96
AVGVSTVS96 / setup.sh
Last active September 7, 2024 21:15
setup.sh
#!/bin/bash
set -uo pipefail
# ------------------------
# --- Helper Functions ---
# ------------------------
log() {
echo ""
echo "$1"
@AVGVSTVS96
AVGVSTVS96 / sdadsad
Created September 5, 2024 06:30
asdsa
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer
@AVGVSTVS96
AVGVSTVS96 / TextAnimation.tsx
Last active April 28, 2024 05:42
Staggered text reveal animation with Framer Motion
import { motion, type Variants } from 'framer-motion';
type TextAnimationProps = {};
const TextAnimation: React.FC<TextAnimationProps> = () => {
const text: string = "Hi, I'm Bassim";
const letters: string[] = Array.from(text);
const container: Variants = {
hidden: { opacity: 0 },
@AVGVSTVS96
AVGVSTVS96 / navMenuSnippet.md
Last active April 28, 2024 05:43
Using shadcn-ui Navigation Menu for button groups

The Radix and shadcn-ui Navigation Menu components can be used without their content to add accessibility and arrow key navigation to any group of buttons or list of links

Using default Navigation Menu styles for buttons with links

export function NavigationMenuDemo() {
  return (
    <NavigationMenu>
      <NavigationMenuList>
        <NavigationMenuItem>
 
@AVGVSTVS96
AVGVSTVS96 / settings.jsonc
Last active April 18, 2024 18:17
Tailwind regex for CVA, CN, and Typescript strings and arrays
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
// typescript types, string or array of classnames, classes in single/double quotes or backticks
["Styles\\s*(?::\\s*[^=]+)?\\s*=\\s*([^;]*);", "['\"`]([^'\"`]*)['\"`]"],
["Classes\\s*(?::\\s*[^=]+)?\\s*=\\s*([^;]*);", "['\"`]([^'\"`]*)['\"`]"]
// // typescript types, classname strings only - classes in single/double quotes or backticks
@AVGVSTVS96
AVGVSTVS96 / tailwind.config.cjs
Created April 14, 2024 04:33
Tailwind REM to PC conversion
theme: {
/**
* Default tailwind values converted from rem to px:
* */
borderRadius: {
none: "0px",
sm: "2px",
DEFAULT: "4px",
md: "6px",
lg: "8px",
@AVGVSTVS96
AVGVSTVS96 / update-git.sh
Last active April 9, 2024 18:26 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@AVGVSTVS96
AVGVSTVS96 / chat.ts
Created February 18, 2024 21:14
OpenAI Cloudflare Workers Function for GPT Chat Application
import { OpenAI } from 'openai';
interface Message {
role: string;
content: string;
}
interface ChatRequest {
messages: Message[];
model_type: string;
@AVGVSTVS96
AVGVSTVS96 / .zshrc
Last active June 3, 2023 03:56
ZSH Prompt - Displays current Git branch and directory with colors in terminal. Customize name 'MacBook-Pro'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
setopt PROMPT_SUBST
PROMPT='%F{cyan}MacBook-Pro%f:%F{green}%1~%f %F{yellow}$(parse_git_branch)%f$ '