Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@faun
faun / COMMIT_EDITMSG
Created April 16, 2025 22:53 — forked from lencioni/COMMIT_EDITMSG
Tim Pope's model commit message
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
@dannguyen
dannguyen / README.openai-structured-output-demo.md
Last active April 28, 2025 03:31
A basic test of OpenAI's Structured Output feature against financial disclosure reports and a newspaper's police blotter. Code examples use the Python SDK and pydantic for the schema definition.

Extracting financial disclosure reports and police blotter narratives using OpenAI's Structured Output

tl;dr this demo shows how to call OpenAI's gpt-4o-mini model, provide it with URL of a screenshot of a document, and extract data that follows a schema you define. The results are pretty solid even with little effort in defining the data — and no effort doing data prep. OpenAI's API could be a cost-efficient tool for large scale data gathering projects involving public documents.

OpenAI announced Structured Outputs for its API, a feature that allows users to specify the fields and schema of extracted data, and guarantees that the JSON output will follow that specification.

For example, given a Congressional financial disclosure report, with assets defined in a table like this:

@mattlord
mattlord / proto_examples.txt
Last active January 25, 2024 17:34
vtctlclient and etcdctl examples
❯ vtctldclient GetTablets
zone1-0000000100 commerce 0 replica localhost:15100 localhost:17100 [] <null>
zone1-0000000101 commerce 0 primary localhost:15101 localhost:17101 [] 2023-09-28T16:37:49Z
zone1-0000000102 commerce 0 rdonly localhost:15102 localhost:17102 [] <null>
zone1-0000000200 customer 0 primary localhost:15200 localhost:17200 [] 2023-09-28T16:39:19Z
zone1-0000000201 customer 0 replica localhost:15201 localhost:17201 [] <null>
zone1-0000000202 customer 0 rdonly localhost:15202 localhost:17202 [] <null>
❯ etcdctl get --prefix /vitess/zone1/tablets/zone1-0000000100/Tablet -w protobuf | protoc --proto_path=${HOME}/git/vitess/proto --decode=topodata.Keyspace topodata.proto
1 {
@mscoutermarsh
mscoutermarsh / DR deploy example.yml
Last active July 1, 2023 19:09
GitHub Actions + PlanetScale example. Get DR number and deploy it.
steps:
- name: checkout
uses: actions/checkout@v3
- name: Setup pscale
uses: planetscale/setup-pscale-action@v1
- name: Get Deploy Requests
if: github.event.pull_request.merged == true
env:
PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
@VonHeikemen
VonHeikemen / completion.lua
Created November 16, 2021 17:20
Sublime-like autocompletion for neovim, using nvim-cmp and luasnip
--[[
Dependencies:
Completion:
https://github.com/hrsh7th/nvim-cmp
https://github.com/hrsh7th/cmp-buffer
https://github.com/hrsh7th/cmp-path
https://github.com/saadparwaiz1/cmp_luasnip
Snippets:
@Lanny
Lanny / README.md
Created June 28, 2021 16:41
File Hierarchy Preview

Outputs a limited file tree rooted at the current directory which highlights the position of the argument within the tree. Originally intended for FZF like so:

fzf --preview 'ptf.py {}'

Screenshot:

screenshot

@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@MelbourneDeveloper
MelbourneDeveloper / Stuff That Software Developers Do.md
Last active April 15, 2024 12:30
Stuff That Software Developers Do

Stuff That Software Developers Do

This is a list of stuff that the average software developer does from week to week

Coding

  • Code design
  • Refactoring
  • Algorithms
  • Profiling
  • Code reviews
  • Building frameworks
@jedna
jedna / entrypoint.sh
Created August 3, 2020 08:52
Simple bash live reload for Go
#!/bin/bash
SERVER=/go/bin/api
# create directory for Delve logs, we use it to know that Delve
# debugger is running
mkdir -p /tmp/dlv_log
runServer() {
echo Running server
@nileshtrivedi
nileshtrivedi / home-server.md
Last active June 1, 2024 00:11
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.