Skip to content

Instantly share code, notes, and snippets.

View tribela's full-sized avatar
😺
😼

Jeong Arm tribela

😺
😼
View GitHub Profile
@tribela
tribela / go-usage.py
Created October 10, 2026 17:04
Opencode Go usage tracker
#!/usr/bin/env -S uv run --quiet --script
# /// script
# requires-python = ">=3.10"
# dependencies = []
# ///
"""opencode-go-usage — pretty terminal view of your OpenCode Go subscription usage.
Shows, for each quota window (5h rolling / weekly / monthly):
* how much you have USED (filled bar, same "used %" the web console shows)
* the RECOMMENDED pace = elapsed fraction of the window
@tribela
tribela / hanoi.py
Last active February 12, 2026 14:56
Hanoi tower, without recursion, Just state -> next state
import pytest
def step_parity(state: list[int]) -> bool:
prev = 0
for p in reversed(state): # From biggest disk to smallest
if p != prev:
prev = 3 - p - prev
return p == prev
@tribela
tribela / mixxx-now-playing.py
Created February 5, 2026 14:54
mixxx-now-playing.py
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "flask",
# ]
# ///
import sqlite3
import os
@tribela
tribela / upgrade.sh
Created September 23, 2023 14:29
Simple mastodon docker compose upgrade script
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")" || exit 1
IMAGE_NAME='qdon/glitch'
TAG='beta'
HOSTNAME='beta.qdon.space'
rollback() {
// ==UserScript==
// @name Fullscreen to lights off
// @version 1
// @grant GM.xmlHttpRequest
// @grant GM.setValue
// @grant GM.getValue
// @match https://app.plex.tv/*
// @match https://watcha.com/*
// @match https://www.netflix.com/*
// @match https://www.disneyplus.com/*
@tribela
tribela / es-nori.dockerfile
Created October 18, 2021 05:02
Make nori-enabled elastic search docker
FROM elasticsearch:7.14.2
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-nori
HEALTHCHECK CMD curl -f http://localhost:9200/_cluster/health
@tribela
tribela / resend_suspended_delete_activity.rb
Last active September 25, 2021 07:43
Resend Delete activity about suspended accounts
# Run "bundle exec sidekiq -q tmp -c 32" to run in side of main sidekiq jobs to prevent huge latency on push queue
dry_run = 1 # Change this to nil to run actually
inboxes = Account.inboxes
worker = ActivityPub::DeliveryWorker.new
worker.sidekiq_options_hash['retry'] = 0
worker.sidekiq_options_hash['queue'] = 'tmp'
processed = 0
@tribela
tribela / glitch.css
Created May 22, 2021 08:39
glitch.css
@keyframes glitch-anim-text {
0% {
transform: none;
clip-path: polygon(0 0, 100% 0, 100% 0%, 0 0%, 0 5vh, 100% 5vh, 100% 100%, 0 100%);
}
9%, 11% {
transform: scale(1, 1);
@tribela
tribela / keybase.md
Created April 14, 2021 01:33
keybase.md

Keybase proof

I hereby claim:

  • I am tribela on github.
  • I am kjwon15 (https://keybase.io/kjwon15) on keybase.
  • I have a public key whose fingerprint is 27E6 CA88 CFBE 2D33 8679 7090 A400 5593 7FB2 BA89

To claim this, I am signing this object:

@tribela
tribela / empty_account.rb
Last active February 10, 2020 08:35
Find empty account from mastodon
# frozen_string_literal: true
Account
.local.without_suspended
.where('accounts.created_at < ?', 30.days.ago)
.where(note: '')
.where(display_name: '')
.where(avatar_file_name: nil)
.where(
Account.arel_table[:fields].eq(nil).or(
Account.arel_table[:fields].eq([])