Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / receipts-recipe.md
Last active November 15, 2026 16:52
Extracting expenses and receipts

Building an LLM-assisted receipt and invoice scanner

How a small Rails bookkeeping app turns a photo or PDF of a receipt into structured expense data, with several small, focused LLM calls using structured output. All prompts and schemas are quoted verbatim. At the end: how the extracted facts become a VAT treatment without the model deciding it, and an end-to-end test to run against your own scans.

It was essential for me that the setup handles cross-border VAT stuff correctly, that the output is sane, that I do not have to check every single value over and over - and that it's reasonably workable from the handwritten service receipts (yes I have these too!) to Stripe invoices for SaaS I have to use.

The app uses RubyLLM 2.x with Claude Haiku 4.5, a 120-second request timeout and three retries with backoff. You can refit this to any language or stack you want - but I like writing Ruby and I have my agents do the same. [There is no reason to write less Ruby, exactly the opposite](h

@julik
julik / README.md
Created September 30, 2026 12:20
caxlsx serialization benchmark: rubyzip (master) vs zip_kit (PR #432)

caxlsx serialization benchmark: rubyzip (master) vs zip_kit (PR #432)

Harness used for caxlsx/caxlsx#432.

It builds a workbook once, then times only Package#serialize (to a file) and Package#to_stream. That separates the ZIP writing cost from building the workbook. Each variant runs in its own process. The median of 9 runs is reported, with allocated objects (GC.stat), allocated bytes (memory_profiler) and process RSS.

Scenarios

@julik
julik / stripe_proxy.rb
Created September 22, 2026 10:45
Stripe proxy controlled from Rails app's Puma
# frozen_string_literal: true
require "puma/plugin"
require "uri"
# How this plugin is wired into the app, for whoever has to set it up again on a
# fresh machine or in a fresh checkout.
#
# 1. The file has to live at lib/puma/plugin/stripe_proxy.rb and nowhere else.
# Puma resolves `plugin :stripe_proxy` as `require "puma/plugin/stripe_proxy"`,
# frozen_string_literal: true
module GenevaDrive
module Admin
# Serves static assets from the engine's public/ directory.
# This keeps all engine URLs under the user-configured mount path,
# avoiding any conflicts with the host application's URL namespace.
class AssetsController < ActionController::Base
# Static assets don't need CSRF protection and must allow
# cross-origin requests (for ES module imports)
# frozen_string_literal: true
module GenevaDrive
module Admin
# Serves static assets from the engine's public/ directory.
# This keeps all engine URLs under the user-configured mount path,
# avoiding any conflicts with the host application's URL namespace.
class AssetsController < ActionController::Base
# Static assets don't need CSRF protection and must allow
# cross-origin requests (for ES module imports)
## STANQUETTE
### INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT
Thank you for your interest in contributing to the open source projects of Stanquette (“Stanquette”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Stanquette must have a Contributor License Agreement ("Agreement") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of Stanquette; it does not change your rights to use your own Contributions for any other purpose.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Stanquette. Except for the licenses granted herein to Stanquette and recipients of software distributed by Stanquette, You reserve all right, title, and interest in and to Your Contributions.
#### Definitions
/*
Encapsulates a number of event handlers that should later
at some point be released. Useful for attaching blocks
of complex interactions to elements or to `document` and then detaching
them in bulk when the component/UI that they are serving is
unmounted or disconnected.
connect() {
this.evm = new EventListenerManager();
// ....
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "async"
gem "ferrum"
gem "state_machines"
gem "breaker_machines"
gem "concurrent-ruby"
gem "nokogiri"
@julik
julik / timetracker.js
Last active June 11, 2025 13:02
Generate a timesheet from Apple Calendar
var Calendar = Application("Calendar")
const calendarName = "My Calendar";
const eventNamePrefix = "Amazing Project 123";
var theCalendar = Calendar.calendars.whose({name: calendarName})[0]
var fromDate = new Date(2025, 4, 25)
var evts = theCalendar.events.whose(
{_and: [
{summary: { _beginsWith: eventNamePrefix }},
def enter!(readonly: false)
Current.site = self
@inside = true
set_appsignal_tags!
@shardine = Shardine.new(connection_config_hash: database_config.merge(readonly:))
@shardine.enter!
end