Skip to content

Instantly share code, notes, and snippets.

Parser Resolution Plan for Interface Support

After analyzing the failing tests and parser errors, I've identified several issues with interface method declarations and type handling. This document outlines a detailed plan to fix the parser to properly support interfaces.

Issues Identified

  1. Method Declaration Syntax: Parser fails to handle both dot notation (Person.greet()) and colon notation (Person:greet()).

  2. Interface Method Signatures: Fails to parse method signatures like greet() tea; in interface definitions.

@jlia0
jlia0 / agent loop
Last active April 9, 2025 16:33
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@echohive42
echohive42 / latent_researcher.txt
Last active March 4, 2025 10:13
latent researcher
import os
import json
from anthropic import AsyncAnthropic
from termcolor import colored
import asyncio
from datetime import datetime
import shutil
import re
# CONSTANTS
@t3dotgg
t3dotgg / try-catch.ts
Last active April 9, 2025 13:40
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@cmackenzie1
cmackenzie1 / updated_at.sql
Created January 31, 2025 16:16
PostgreSQL Updated at column trigger
-- Function to automatically update the updated_at column
CREATE OR REPLACE FUNCTION update_updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
-- Apply the trigger to all tables with an updated_at column
@N8python
N8python / pretrain.py
Created January 15, 2025 23:41
Simple character-level pretraining in MLX. Gets a roughly billion tokens/day for an 18M parameter model on one M3 Max.
import json
import random
import mlx.optimizers as optim
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from tqdm import tqdm
import time
from datetime import datetime
@deepfates
deepfates / convert_archive.py
Created November 17, 2024 19:33
Convert your twitter archive into a training dataset and markdown files
import argparse
import json
import logging
import os
import re
import shutil
from concurrent.futures import ProcessPoolExecutor, as_completed
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@hanxiao
hanxiao / testRegex.js
Last active March 21, 2025 06:53
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
#!/usr/bin/env python3
import usb.core
import struct
from collections import namedtuple
APPLE_VID = 0x05ac
Target = namedtuple("Target", ["vid", "pid", "name", "model", "total_size"])