Skip to content

Instantly share code, notes, and snippets.

View rupertlssmith's full-sized avatar

Rupert Smith rupertlssmith

  • The Sett Ltd.
  • Edinburgh, Scotland.
View GitHub Profile
@rupertlssmith
rupertlssmith / agenda.md
Last active May 28, 2025 12:28
Lamdera Talk
@rupertlssmith
rupertlssmith / codebase_chat_cli_v1.3.py
Created May 13, 2025 14:41 — forked from somera/codebase_chat_cli_v1.3.py
Codebase Chat CLI - A command-line interface for interacting with codebases using local LLMs via Ollama.
#!/usr/bin/env python3
"""
Codebase Chat CLI - GPU Accelerated
A command-line interface for interacting with codebases using local LLMs via Ollama.
Supports GPU acceleration for improved performance and ChromaDB for vector indexing.
Features:
- Vector index creation of source code files with ChromaDB and Ollama embeddings
- .codechatignore support for excluding files/folders
@rupertlssmith
rupertlssmith / ModalGroup.elm
Created September 17, 2024 10:22
Modal groups and tests for them in Elm
module ModalGroup exposing (..)
{-| A ModalGroup is a collection of items, zero or one of which can be active at a time.
It is intended for modelling the behaviour of modal dialog boxes, where at most one dialog box can
be open at a time.
-}
import Dict exposing (Dict)
@rupertlssmith
rupertlssmith / elm-grammar.ebnf
Created January 30, 2024 08:11 — forked from charbelrami/elm-grammar.ebnf
Elm EBNF grammar
program = [ comment ], [ "port" ], "module", module_name, "exposing", "(", exposed_list, ")", { import_statement }, { declaration }, { comment };
module_name = identifier, { ".", identifier }, [ comment ];
exposed_list = identifier | "(", identifier, { ",", identifier }, ")", [ comment ] | "..";
import_statement = "import", module_name, [ import_alias ], [ "exposing", "(", exposed_list, ")" ], [ comment ];
import_alias = "as", identifier, [ comment ];
declaration = type_declaration
| type_alias_declaration
@rupertlssmith
rupertlssmith / xen-and-systemd
Created December 11, 2023 11:27 — forked from paleo9/xen-and-systemd
Integrating Xen 4.2 with Systemd.
Integrating Xen 4.2 AUR with Systemd.
=================================
I tested the AUR package with a fresh installation of Arch of x86_64. Only
packages 'base', 'base-devel'and the dependencies mentioned on the site
were installed.
* package build also requires dev86
* dev86 is in multilib, x86_64 users need to enable multilib in /etc/pacman.conf
* users need to add a new entry to their bootloader config file (mentioned)
class Resizeable extends HTMLElement {
constructor() {
super();
this.resizeCallback = this.resizeCallback.bind(this);
this._observer = new ResizeObserver(this.resizeCallback);
}
connectedCallback() {
this._observer.observe(this);
@rupertlssmith
rupertlssmith / Existential.elm
Created December 19, 2022 12:40
Type hiding in Elm by using continuations.
module Existential exposing (add, impl, init, map, wrap)
impl : t -> (raise -> rep -> t)
impl constructor =
\raise rep -> constructor
wrap : (raise -> rep -> t) -> (raise -> rep -> (t -> q)) -> (raise -> rep -> q)
wrap method pipeline raise rep =
@rupertlssmith
rupertlssmith / DGrammar.elm
Created December 6, 2022 14:41
DSL for Diagrammer Clone
module DGrammar exposing (..)
import BoundingBox2d exposing (BoundingBox2d)
import Color exposing (Color)
import Point2d exposing (Point2d)
import Quantity exposing (Unitless)
import Vector2d exposing (Vector2d)
type alias DGram =
@rupertlssmith
rupertlssmith / Camera2d.elm
Created November 9, 2022 10:05
Elm 2d Camera
module Camera2d exposing
( Camera2d
, zoomedAt
, origin
, moveTo, translateBy, translateByScreen
, adjustZoom, adjustZoomScreen
, pToScene, pToScreen, svgViewBox
)
{-| A Camera2d maps a 2d scene to a screen.
module Main exposing (main)
import Browser
import Html exposing (Html)
import Html.Events
import Json.Decode
import Json.Encode
type alias Flags =