This file contains hidden or 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
# Node.js project shortcuts (requires 'ni' package manager - https://github.com/antfu-collective/ni) | |
alias d="nr dev" # npm/pnpm/yarn run dev | |
alias s="nr start" # npm/pnpm/yarn run start | |
alias i="ni" # Install dependencies | |
alias u="nun" # Uninstall a a package | |
alias up="nlx taze" # Update dependencies to latest versions | |
# Open Cursor app | |
alias c="open $1 -a \"Cursor\"" |
This file contains hidden or 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 { promises as fs } from 'fs'; | |
import path from 'path'; | |
const SKIP_EXTENSIONS = [ | |
'.svg', | |
'.png', | |
'.jpg', | |
'.jpeg', | |
'.gif', | |
'.ico', |
This file contains hidden or 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
/// <reference path="../pb_data/types.d.ts" /> | |
routerAdd('GET', '/ai-chat', async (e) => { | |
try { | |
const OpenAI = require(`${__hooks}/node_modules/openai/index.js`); | |
const openai = new OpenAI({ | |
apiKey: 'OPEN_API_KEY', | |
}); | |
const completion = await openai.chat.completions.create({ |
This file contains hidden or 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
/* | |
____ _ _ _ _ _ _ _ | |
/ ___|| |_ _ __(_)_ __ ___ | | | | |_(_) |___ | |
\___ \| __| '__| | '_ \ / _ \ | | | | __| | / __| | |
___) | |_| | | | |_) | __/ | |_| | |_| | \__ \ | |
|____/ \__|_| |_| .__/ \___| \___/ \__|_|_|___/ | |
|_| | |
Purpose: |
This file contains hidden or 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
<template> | |
<div class="p-4 bg-gray-100 rounded-md border flex flex-col justify-center items-center overflow-hidden"> | |
<div class="font-extrabold text-lg [text-wrap:balance] text-gray-700"> | |
We design and develop the best | |
<span class=" inline-flex flex-col h-[calc(theme(fontSize.lg)*theme(lineHeight.tight))] overflow-hidden"> | |
<ul class="block text-left leading-tight [&_li]:block animate-text-slide"> | |
<li class="text-indigo-500">Mobile apps</li> | |
<li class="text-rose-500">Websites</li> | |
<li class="text-yellow-500">Admin dashboards</li> | |
<li class="text-teal-500">Landing pages</li> |
This file contains hidden or 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 url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); | |
:root { | |
--font-size-large: 1rem !important; | |
--text-gray-dark: #334155 !important; | |
} | |
body { | |
font-family: "Inter", sans-serif !important; | |
} |
This file contains hidden or 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
const { default: PostalMime } = require("postal-mime"); | |
const AI_MODEL = "gpt-3.5-turbo"; | |
const OPEN_AI_API_KEY = "YOUR_API_KEY_HERE"; | |
const streamToArrayBuffer = async (stream, streamSize) => { | |
const result = new Uint8Array(streamSize); | |
let bytesRead = 0; | |
const reader = stream.getReader(); | |
while (bytesRead < streamSize) { | |
const { done, value } = await reader.read(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<script src="https://cdn.tailwindcss.com"></script> | |
</head> | |
<body> |
This file contains hidden or 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
<template> | |
<main class="py-24 bg-slate-50 min-h-screen"> | |
<div class="border-shadow"> | |
<div class="max-w-4xl mx-auto"> | |
<div ref="wrapper" class="flex items-center relative"> | |
<div | |
ref="highlighter" | |
class="bg-slate-200 absolute top-3 rounded-md h-8 transition-all duration-150" | |
:style="highlightStyles" | |
></div> |
This file contains hidden or 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
// Created by Fayaz https://twitter.com/fayazara | |
let widget = await createWidget(); | |
if (config.runsInWidget) { | |
Script.setWidget(widget); | |
} else { | |
widget.presentSmall(); | |
} | |
Script.complete(); |
NewerOlder