Skip to content

Instantly share code, notes, and snippets.

@pguso
pguso / first-exercise.js
Created November 6, 2025 06:52
Building LangChain & LangGraph Concepts From Scratch (Next Step in My AI Agents Repo) - First Part of Lesson 1
/**
* Exercise 1: Build a Multiplier Runnable
*
* Goal: Create a Runnable that multiplies numbers by a factor
*
* Requirements:
* - Takes a number as input
* - Multiplies by a factor set in constructor
* - Returns the result
*
@pguso
pguso / rag-from-scratch.md
Last active November 3, 2025 11:12
Building "RAG from Scratch" in plain JavaScript. Feedback on repo structure?

RAG from Scratch

Demystify Retrieval-Augmented Generation (RAG) by building it yourself - step by step.
No black boxes. No cloud APIs. Just clear explanations, simple examples, and local code you fully understand.

This project follows the same philosophy as AI Agents from Scratch:
make advanced AI concepts approachable for developers through minimal, well-explained, real code.


@pguso
pguso / deploy_llm.py
Created September 22, 2025 16:26
LLMs on Modal: From Idle GPUs to Pay-Per-Token
from typing import Optional
from pathlib import Path
import modal
app = modal.App("llms-llama-cpp")
MODEL = "Qwen3-Coder-30B-A3B-Instruct-Q2_K.gguf"
GPU_CONFIG = "A10"
LLAMA_CPP_RELEASE = "b4568"
MINUTES = 60
@pguso
pguso / gist:26f0707d02bd7fe63133f846cc276508
Created November 2, 2022 15:14
Elrond Crowdfunding Smart Contract
#![no_std]
elrond_wasm::imports!();
elrond_wasm::derive_imports!();
#[derive(TopEncode, TopDecode, TypeAbi, PartialEq, Eq, Clone, Copy, Debug)]
pub enum Status {
FundingPeriod,
Successful,
Failed,
@pguso
pguso / nft-market.sol
Last active February 28, 2023 19:02 — forked from dabit3/basicmarket.sol
Basic NFT Marketplace with Price Feed (MATIC to USD)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract NFT is ERC721URIStorage {
@pguso
pguso / setup-data-analysis-environment-with-typescript.md
Last active September 10, 2021 07:52
Setup Data Analysis Environment with Typescript and Plotly

Setup Data Analysis Environment with Typescript

Similar to Pandas & Jupyter Notebook in Python

In this tutorial we will set up an environment to make data analysis with typescript and write our code in an experimental environment like Jupyter Notebook.

The following part is copied from https://github.com/yunabe/tslab.

Installing tslab

@pguso
pguso / gist:e92a0769e5c1636eb8b3
Created February 2, 2016 11:30 — forked from davedevelopment/gist:2884984
Print routes and where they're defined for a silex app
#!/usr/bin/env php
<?php
# bin/routes
$app = require __DIR__ . '/../app/bootstrap.php';
$routes = $app['routes']->all();
foreach($routes as $route) {
$cr = new ReflectionFunction($route->getDefault('_controller'));