Skip to content

Instantly share code, notes, and snippets.

View philwinder's full-sized avatar

Phil Winder philwinder

View GitHub Profile
@philwinder
philwinder / after_cline_adding_kodit.txt
Created August 15, 2025 17:21
Kodit Demo - Simple Go Microservice - Full Transcripts
**User:**
<task>
Develop a new Go microservice that exposes functionality for a notional "shipping" department. They need to list current orders from the orders microservice and get the user's information for each order. This should then expose a rest API to list out today's orders and where they need to be shipped. It should also have an API to update an order status to say it has been shipped.
Use internal Go libraries only for this.
</task>
<environment_details>
# VSCode Visible Files
(No visible files)
@philwinder
philwinder / main.go
Created June 12, 2025 08:12
A mock "orders" microservice in Go (Toy Example)
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
// Order represents an order entity
@philwinder
philwinder / main.go
Created June 12, 2025 08:09
A mock "users" microservice in Go (Toy example)
package main
import (
"encoding/json"
"log"
"net/http"
"strings"
)
// User represents a user entity
@philwinder
philwinder / knock-knock-server.py
Created June 6, 2025 14:21
A proprietary auth mechanism that requires you to knock three times to gain access (Toy example)
import json
import secrets
from http.server import BaseHTTPRequestHandler, HTTPServer
from rich.console import Console
# Store knock counts and tokens
knock_counts: dict[str, int] = {}
console = Console()
@philwinder
philwinder / Fine-tune a Quantized Large Language Model on a Single GPU (Falcon-7B).ipynb
Created October 4, 2023 10:07
Fine-tune a Quantized Large Language Model on a Single GPU (Falcon-7B)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from sklearn.base import BaseEstimator, TransformerMixin
class TypeSelector(BaseEstimator, TransformerMixin):
def __init__(self, dtype):
self.dtype = dtype
def fit(self, X, y=None):
return self
def transform(self, X):
assert isinstance(X, pd.DataFrame)
return X.select_dtypes(include=[self.dtype])
@philwinder
philwinder / example_build.json
Last active July 17, 2018 10:33
Packer does not wait for build to finish on windows 10 build
{
"builders": [
{
"type": "amazon-ebs",
"iam_instance_profile": "{{user `s3_readonly_instance_role`}}",
"region": "{{ user `aws_region` }}",
"profile": "{{ user `aws_profile` }}",
"instance_type": "g3.4xlarge",
"source_ami": "{{ user `windows_base_ami` }}",
"ami_name": "vws-win10-{{timestamp}}-{{user `build_id`}}",
@philwinder
philwinder / grafana-configmap.yaml
Created March 20, 2017 14:19
Failing k8s configmap due to length of file.
apiVersion: v1
data:
grafana-net-315-dashboard.json: |
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
@philwinder
philwinder / docker_tags.sh
Created January 10, 2017 15:38
Tests V1 and V2 apis to get container tags from docker hub api
#!/bin/bash
# Tests V1 and V2 API for getting tags. The V1 api is garbage, but the V2 api isn't fully implemented.
# -------
set -e
echo
echo ""
echo "Testing V2 api"
@philwinder
philwinder / Mesos CNI example bug
Created June 24, 2016 09:41
Logs from Mesos and commands showing state of CNI config.
#### Mesos Settings:
ubuntu@ip-10-0-0-21:~$ ls -laR /etc/mesos-slave/
/etc/mesos-slave/:
total 36
drwxr-xr-x 2 root root 4096 Jun 24 07:50 .
drwxr-xr-x 115 root root 4096 Jun 24 07:50 ..
-rw-r--r-- 1 root root 6 Jun 24 07:50 executor_registration_timeout
-rw-r--r-- 1 root root 47 Jun 24 07:50 hostname
-rw-r--r-- 1 root root 7 Jun 24 07:50 image_providers
-rw-r--r-- 1 root root 32 Jun 24 07:50 isolation