Skip to content

Instantly share code, notes, and snippets.

View Wintus's full-sized avatar
📡
on the ground

wint Wintus

📡
on the ground
  • Tokyo
  • 15:58 (UTC +09:00)
  • X @wint7
View GitHub Profile
@Wintus
Wintus / zip-merge.rs
Last active January 3, 2026 07:21
Merging ZIP Files Without Deflation
use std::fs::File;
use std::io::{self, Read, Seek, SeekFrom, Write};
use std::path::PathBuf;
use zip::read::ZipArchive;
use zip::result::ZipResult;
#[derive(Debug)]
struct EntryInfo {
filename: String,
@Wintus
Wintus / incident-response-model.mermaid
Created January 2, 2026 16:58
Observability and Incident Response
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Wintus
Wintus / wording.md
Created January 1, 2026 14:55
Wording guideline for terminology precision (human & LLM agents)

Wording

Algorithm vs Expression vs Logic

  • Algorithm: Abstract step-by-step procedure for computation (imperative).
  • Expression: Compositional structure evaluated under arbitrary semantics (declarative).
  • Logic: Reasoning about validity of arguments (deductive or inductive).

Prefer "algorithm" for imperative code, "expression" for declarative code, and "logic" only for truth-valued reasoning.

@Wintus
Wintus / div-rel.rb
Last active February 8, 2025 09:54
discrete mathematics
# make Rel in Hasse diagram
# 0 and 1 are trivial and omitted
require 'prime'
Graph = Data.define(:nodes, :edges) do
def initialize(nodes: [], edges: [])
super
end
end
@Wintus
Wintus / bb26.rb
Created November 22, 2024 16:14
The bijective base-26 system
def naive(n)
s = ?A
(n-1).times { s.succ! }
s
end
def digits(n, base=10)
ds = []
while n > 0
case n.divmod(base)
Copyright (c) <year> <copyright holders>
This software is provided ‘as-is’, without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
@Wintus
Wintus / FizzBuzz.sh
Created August 4, 2024 14:24
find mkdir system
mkdir -p d/x
find d -regextype posix-extended -regex 'd(/x){1,29}' -exec mkdir -p '{}'/x \;
find d -regextype posix-extended \
-regex 'd((/x){3})+' -printf "Fizz" , \
-regex 'd((/x){5})+' -printf "Buzz" , \
-regex 'd((/x){3})+' -o \
-regex 'd((/x){5})+' -o \
-regex 'd(/x)+' -printf "%d" , \
@Wintus
Wintus / solution.sql
Last active July 24, 2024 15:48
GSP787
SELECT sum(cumulative_confirmed) as total_cases_worldwide
FROM `bigquery-public-data.covid19_open_data.covid19_open_data`
WHERE date=?
;
WITH
deaths_by_states AS (
SELECT
subregion1_name AS state,
SUM(cumulative_deceased) AS death_count
@Wintus
Wintus / ec.sql
Last active July 24, 2024 14:02
GSP341
CREATE OR REPLACE MODEL `ecommerce.customer_classification_model`
OPTIONS
(
model_type='logistic_reg',
labels = ['will_buy_on_return_visit']
)
AS
#standardSQL
SELECT
* EXCEPT(fullVisitorId)