Skip to content

Instantly share code, notes, and snippets.

View ahmadrosid's full-sized avatar
🔥
On fire

ahmadrosid ahmadrosid

🔥
On fire
View GitHub Profile

Web search tool

The web search tool gives Claude direct access to real-time web content, allowing it to answer questions with up-to-date information beyond its knowledge cutoff. Claude automatically cites sources from search results as part of its answer.

Please reach out through our feedback form to share your experience with the web search tool.

Supported models

Web search is available on:

Handle vercel ai sdk tool call in the client with react

To handle and render custom UI in the client when a tool call runs using @ai-sdk/react, you can use the useChat hook’s built-in tooling support—specifically onToolCall, message.parts, and addToolResult.

Use useChat on the client

Import the hook and set up onToolCall and addToolResult in your React page:

'use client';

Here’s a full breakdown of the AI SDK data stream protocol, which is used by tools, frontends (like useChat), and custom backends—even in non-JS environments:

📡 Stream Protocol Overview

When you stream from the backend (e.g., your Python/FastAPI server), you must use the Data Stream Protocol. Make sure to set the HTTP header:

x-vercel-ai-data-stream: v1
@ahmadrosid
ahmadrosid / globe-animation-vanta-js.markdown
Created January 20, 2025 08:46
Globe animation - Vanta JS
@ahmadrosid
ahmadrosid / How to make something great.md
Created January 10, 2025 18:46
How to make something great

This article is bookmarked from: https://ryolu.notion.site/how-to-make-something-great

In the pantheon of creative endeavors—be it product design, art, architecture, software, or some hybrid creature of the mind—true greatness emerges not from any single stroke of genius, but from a careful cultivation of potential. There’s a quiet, almost mystical art to starting with something so unrefined that you’re unsure if it’s mud or marble, and patiently revealing its shape until others recognize its beauty. In the end, they’ll say: “Of course! It’s so obvious.” But what they see is only the final state. What you know is the hidden complexity—how the stone could have cracked and fallen to rubble at any misstep.

Begin with the Ambiguous Artifact

A truly fertile concept often resists immediate clarity. It’s a rough form: a half-lit corridor where you see only silhouettes and faint hints of what could be. Resist the urge to force early perfection. Instead, feel its potential: a spaciousness that can accommodate

Rust's lifetime

Imagine you have a toy box (memory):

  1. When you take out a toy (create a variable), Rust wants to know how long you're going to play with it

  2. The 'lifetime' is like a promise you make to Rust saying "I'll put the toy back when I'm done playing with it"

In your specific example about reading 100 bytes from a file:

  • It's like telling Rust "I'm borrowing these 100 bytes of information, and I promise to handle them carefully until I'm done using them"
@ahmadrosid
ahmadrosid / google-trend.js
Created November 15, 2024 17:40
Get google trend using selenium scripts.
const {Builder, By, Key, until} = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const options = new chrome.Options();
// Add headless mode configurations
options.addArguments('--headless'); // Run in headless mode
options.addArguments('--disable-gpu'); // Disable GPU hardware acceleration
options.addArguments('--no-sandbox'); // Bypass OS security model
options.addArguments('--disable-dev-shm-usage'); // Overcome limited resource problems

Menjawab pertanyaan dari group telegram ngooding

Untuk bisa jalankan project laravel di dalam subfolder laravel yg berjalan ada yg tau ?

Disini saya coba mau akses subdomain.domain.id/v2 untuk akses project latest nya.

Sudah coba2 atur Vhost Nginx masih belum berhasil. Siapa tau temen2 ada yg pernah mencoba.

Terimakasih

JavaScript/TypeScript Stack vs Laravel Ecosystem Comparison

Laravel Ecosystem JS/TS Equivalent or Potential Solution
1. Breeze Could be implemented with Remix templates
2. Cashier Potential for a custom solution using Stripe/Paddle APIs
3. Dusk Playwright or Cypress for E2E testing
4. Echo Socket.io or custom WebSocket solution
5. Envoyer CI/CD tools like GitHub Actions or custom scripts
6. Forge Cloud platforms like Vercel, Netlify, or custom server management
@ahmadrosid
ahmadrosid / Better Laravel Jetstream Team Invitations.md
Created August 1, 2024 11:08
Better Laravel Jetstream Team Invitations

Source: https://mariogiancini.com/making-laravel-jetstream-team-invitations-better

Making Laravel Jetstream Team Invitations Better | Mario Giancini

Tags: UX, PHP, Laravel, Code

Jetstream is a powerful package for Laravel that allows you to create a Team-based experience (Jetstream Teams) for your new web application. I've used it in several projects and the latest version 2.x has added a number of improvements that I appreciate.

The Problem With Team Invitations