Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
"use client";
import { useChat } from "@ai-sdk/react";
import { DefaultChatTransport } from "ai";
import { useState } from "react";
export default function Chat() {
const [input, setInput] = useState("");
const [imageUrl, setImageUrl] = useState("");
const [imageFile, setImageFile] = useState<File | null>(null);
const weatherTool = createTool({ });
const server = new MCPServer({
name: "my-mcp-server",
version: "1.0.0",
tools: { weatherTool },
});
// add ...tools to agent.tools[]
const mcp = new MCPClient({
servers: {
hackernews: {
command: "npx",
args: ["-y", "@devabdultech/hn-mcp-server"],
}
},
import { createWorkflow, createStep } from "@mastra/core/workflows"
import { z } from "zod"
import { gameAgent } from "../agents/example-game-agent"
const famousPeople = [
"Taylor Swift",
"Eminiem",
"Elon Musk",
"Steve Jobs",
"Beyonce",
{
"global": { "show_in_menu_bar": false },
"profiles": [
{
"complex_modifications": {
"parameters": { "basic.to_if_held_down_threshold_milliseconds": 1000 },
"rules": [
{
"description": "Map Command + Option + L to Fn + Control + Right Arrow",
"enabled": false,
"use client";
import { authClient } from "@/lib/auth-client";
import UserDropdown from "./user-dropdown";
import { useRouter } from "next/navigation";
import SignInAndSignUpButtons from "./sign-in-and-sign-up-buttons";
export default function UserButton() {
const session = authClient.useSession();
const router = useRouter();
@bookercodes
bookercodes / redirect-map.json
Created March 19, 2024 07:50
Map from scrimba.com/podcast to podcast.scrimba.com episode links (including the script)
{
"map": [
{
"from": "https://scrimba.com/podcast/getting-your-first-developer-job",
"to": "https://podcast.scrimba.com/1"
},
{
"from": "https://scrimba.com/podcast/bus-driver-becomes-developer",
"to": "https://podcast.scrimba.com/2"
},
import { createServer } from 'http'
import { WebSocketServer } from 'ws'
import { parse } from 'url'
const PORT = 8000
const server = createServer()
// noSever: Tells WebSocketServer not to create an HTTP server
// but to instead handle upgrade requests from the existing
// server (above).
const wsServer = new WebSocketServer({ noServer: true })
const foo = require("foo")
const boo = require("boo")
foo.seconds(2) // 2000
foo.minutes(2) // 120000
boo.seconds(2000) // 2
boo.minutes (120000) // 2

Kbd map

  • ESC + HJKL

  • ESC + F1, F3, etc. 👆 I don't want my mech keyboard binsd to be too different from what I would use on the Mac

  • Caps + HJKL to navigate windows\

  • Caps + Shift + HJKL to move windows around