brew install npm
npm install langchain
- make sure the
package.json
looks like
{
"name": "your-project-name",
"type": "module",
"dependencies": {
"langchain": "^0.0.95"
Deno.bench("Deno, Bun, Node.js TypeScript Benchmarks", async (b) => { | |
// Open a file that we will act upon. | |
// using file = await Deno.open("a_big_data_file.txt"); | |
// Tell the benchmarking tool that this is the only section you want | |
// to measure. | |
b.start(); | |
// Now let's measure how long it takes to read all of the data from the file. | |
// await new Response(file.readable).arrayBuffer(); |
-- Query the API directly and flatten the nested JSON structure | |
WITH raw_data AS ( | |
SELECT * FROM read_json_auto('https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=did:plc:edglm4muiyzty2snc55ysuqx&limit=10') | |
), | |
unnested_feed AS ( | |
SELECT unnest(feed) as post_data FROM raw_data | |
) | |
SELECT | |
-- Post basics | |
post_data.post.uri as post_uri, |
import { getZodConstraint, parseWithZod } from "@conform-to/zod" | |
import type { HTMLAttributes } from "astro/types" | |
import { ZodAny, z, type ZodIssue } from "zod" | |
export type Constraint = ReturnType<typeof getZodConstraint>[0] | |
export type FieldAttributes = { | |
name: string | |
value: string | |
type: NonNullable<HTMLAttributes<"input">["type"]> | |
} & Partial<Record<Lowercase<keyof Constraint>, any>> |
import json | |
import os | |
import duckdb | |
import boto3 | |
import datetime | |
from typing import Any, Dict | |
def construct_prepared_sql_and_params(sql_template, bind_params): | |
single_value_params = {k: v for k, v in bind_params.items() if not isinstance(v, list)} |
import {Config, EventBus, EventBusRuleProps, Queue, Stack, StackContext, Table} from "@serverless-stack/resources"; | |
const snakeToCamel = (s: string) => s.replace(/(_\w)/g, k => k[1].toUpperCase()); | |
const addBusinessRule = (stack: Stack, bus: EventBus, dlq: Queue, eventType: string) => { | |
const ruleKey = eventType.replace(".", "_"); | |
const queueName = `${ruleKey}_queue`; | |
const handlerLambda = `functions/events/${snakeToCamel(ruleKey)}/handler.main`; | |
const rules: Record<string, EventBusRuleProps> = {}; |
"use client" | |
import { CalendarDateTime, isToday as _isToday, } from "@internationalized/date"; | |
import { format } from "date-fns"; | |
import { CalendarIcon, ClockIcon } from "lucide-react"; | |
import { useRef, useState } from "react"; | |
import { DateValue, TimeValue, useDateSegment, useInteractOutside, useLocale, useTimeField } from "react-aria"; | |
import { DateFieldState, DatePickerStateOptions, DateSegment as IDateSegment, useDatePickerState, useTimeFieldState } from "react-stately"; | |
import { cn } from "../lib/utils"; | |
// imports from shadcn/ui | |
import { Button } from "./ui/button"; |
/** | |
* USERS | |
* Note: This table contains user data. Users should only be able to view and update their own data. | |
* Some data is synced back and forth to `auth.users` as described below. | |
* | |
* `full_name`: synced in both directions | |
* `email`: synced from user metadata to profile only | |
* `avatar_url`: synced from user metadata to profile only | |
* `terms_accepted_at`: synced from profile to user metadata only | |
*/ |
const AWS = require("aws-sdk"); | |
const csv = require("csv-parser"); | |
const { Readable } = require("stream"); | |
const simpleParser = require("mailparser").simpleParser; | |
const s3 = new AWS.S3(); | |
const documentClient = new AWS.DynamoDB.DocumentClient(); | |
const TableName = process.env.TABLE; |
brew install npm
npm install langchain
package.json
looks like{
"name": "your-project-name",
"type": "module",
"dependencies": {
"langchain": "^0.0.95"