$ cat ./posty/devlogi/pivot-devlog-0.md

cutty devlog #0 — why another link shortener

maj 19 12:07 | 3 min | autor: esej | #devlogi
● update 2026-05-19 — the pivot project has evolved into cutty.dev. This devlog is the history of its development, but the product lives on under a new name and a new stack.

$ git log --oneline pivot/

pivot has its documentation page at /projekty/pivot/, where everything is organized like in a README: features, stack, API, roadmap. Professional. Impersonal. As if the project was written by a competent team that has standup every morning.

This post is about how it really looked. A bit about how one of those "competent people" is me, the other is also me, and standup is done by Simba at six in the morning, lying on the keyboard.

== prologue ==

Two years ago, I pasted a link to a Google Drive document for a friend. The link was 217 characters long, of which 180 was an authorization token looking like a neighbor's wifi password. The friend looked at it, said "hey, can you send this to me differently" and went to make himself a coffee.

Then I thought: I need my own shortener.

Then I didn't have it for two years.

== "it's a weekend job" ==

This is the sentence every programmer says at least once before every project that takes them three months. I said it on Saturday, May 17, around 22:30, after the third espresso and one thought: "what am I actually doing with my life if I don't have my own link shortener".

The first thing I wrote — the name. Because a good name does 70% of the project, and a bad one kills it before anyone writes the first line of code. (Yes, I have projects that failed because the name sounded stupid. Don't ask.)

The list of names I considered:

  • ln — unix command, ideal semantics, but sounds like a car registration
  • jmp — assembler jump, hardcore, but 90% of recipients won't get it
  • 301 — HTTP redirect code, the first thought of a normal person: "what kind of error is this"
  • tnij — Polish command, homey, but loses the unix-vibe
  • cut, sed, mov, hop, bounce, warp — all good, but too soft

In the end, it was pivot. From Metasploit — in pentester slang pivot is jumping through a compromised host to get further into the network. A short link is literally a pivot through my host to your target. Semantically it fits, sounds scarier than "shortener", and is simple enough that grandma won't ask what it means. Because she won't ask — she'll ignore it. Better.

== plan for MVP ==

Three endpoints, one table:

POST /pivot          # creates a short link
GET  /p/{slug}       # 301 redirect
GET  /p/{slug}+      # statistics (plus at the end like in bit.ly)

Database schema:

CREATE TABLE wp_esej_pivot (
  slug VARCHAR(8) PRIMARY KEY,
  url TEXT NOT NULL,
  hits INT DEFAULT 0,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

And that's all. base62 dictionary, 4 characters = 14.7M unique. I generate a random one, check if there's a collision, if there is — retry. Statistically unattainable with my few dozen links per month, but I like code that makes sense even in theory.

== what has already been done ==

  • [x] name
  • [x] spec (THIS post + the /projekty/pivot/ page)
  • [x] decision: no new runtime, everything in PHP inside the WP theme

== what is not yet ==

  • [ ] any lines of code

But don't worry. Next week.

(If Simba allows.)


// PS: if any of you have had your own link shortener since the weekend and somehow haven't died yet — let me know, we'll compare databases.

// PPS: if any of you DON'T YET HAVE your own link shortener — what are you doing with your life.