Skip to content

Instantly share code, notes, and snippets.

@wesen
wesen / programming-with-ai.md
Created March 8, 2024 22:04
AI programming slides

Programming with AI


Fundamentals

  • Autoregressive
  • Context size

Autoregression

2023 05 25

Coworking today.

Generate some examples for a config file for sqleton serve

I want to get a couple of ideas for a config file structure to configure sqleton. I started by asking the ai straight, but then realized I would like to have couple more takes on the whole thing.

First suggestion YAML

@wesen
wesen / machine.js
Created October 21, 2023 21:40
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'telemetry',
initial: 'A_OFF',
context: {
timestampStart: null,
currentADuration: 0,
currentCounter: 0,
},
states: {
A_OFF: {

2023 07 21 Go Monads

Technical Team Composition: The Tree Center (TTC)

1. Infrastructure / DevOps

Definition: A technical role focused on maintaining and improving the company's software infrastructure, which includes the servers, databases, and networks required for application deployment and performance.

Responsibilities

  • Setting up, managing and maintaining AWS infrastructure
  • Setting up and maintaining 3rd party services (Rollbar, Datadog, payment processors, GTM, others)
  • Ensuring website and server stability (on-call responsibilities)
#+title: 2023 07 15
#+begin_ai :noweb yes
[SYS]: You are an expert programmer specialist in golang. You give concise answers for expert users. You write unit tests, fuzzing and CLI tools with cobra, errgroup, and bubbletea. You pass context.Context around for cancellation. You use modern golang idioms.
[ME]: Write a simple app that retrieves a thread from mastodon and prints out the individual messages.
[AI]: Here's an example of a simple application that fetches and prints a thread from a Mastodon social network. It uses a basic client, without OAuth, which retrieves publicly accessible toots. Please replace `<instance_url>` and `<status_id>` with actual values.
```go
#+begin_ai :noweb yes :temperature 0.2
[SYS]: You are an expert programmer specialist in PHP. You give concise answers for expert users.
You use php 8.2 with psalm annotations, phpunit tests and PSR12.
You use readonly dataclasses and type annotations.
[ME]:
[ME]: <<sqlbuilder>>
Create a DSL (YAML based) to represent the conversion from arguments to SQL query using the query builder. We want to refactor the builder to b more elegant. Add many `description` fields that have a concise documentation of the DSL elements. The DSL should follow the structure of the $options array. Output the DSL that represents building the PurchaseOrder query.
#+begin_ai :noweb yes :temperature 0.2
[SYS]: You are an expert programmer specialist in PHP. You give concise answers for expert users.
You use php 8.2 with psalm annotations, phpunit tests and PSR12.
You use readonly dataclasses and type annotations.
[ME]: <<sqlbuilder>>
Given the following table: <<giftcardsSQL>>, build a Find method to search the table.
If the query is numeric, search for the id, otherwise search against the code.
cat /home/manuel/code/ttc/ttc/tadmin/plugin/bin/inventory.php

2023 07 12