Skip to content

Instantly share code, notes, and snippets.

View Lysak's full-sized avatar
🎯

Dmytrii Lysak

🎯
View GitHub Profile
@Lysak
Lysak / README.md
Last active June 23, 2026 06:12
Fix: Codex SQLite logs ~640 TB/year SSD write issue (openai/codex#28224) - aka fix codex ssd issue

Fix: Codex SQLite logs ~640 TB/year SSD write issue

Fixes openai/codex#28224.

Codex writes millions of TRACE-level rows per day to ~/.codex/logs_2.sqlite via insert-and-prune churn, rapidly consuming SSD write endurance.

Files

  • block-logs-trigger.sh — watcher script
  • com.codex.block-logs-trigger.plist — macOS LaunchAgent
@Lysak
Lysak / replaces-cloudflare-blocked-font-awesome-fonts-on-swappa.user.js
Last active June 17, 2026 12:38
Replaces Cloudflare-blocked Font Awesome fonts on Swappa
This file has been truncated, but you can view the full file.
// ==UserScript==
// @name Swappa Font Awesome Fix (Embedded Original Fonts)
// @namespace https://github.com/Lysak
// @version 2026-06-17
// @description Uses locally embedded Swappa Font Awesome webfonts to bypass Cloudflare font challenges
// @author Dmytrii Lysak
// @match https://swappa.com/*
// @match https://*.swappa.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=swappa.com
// @run-at document-start
@Lysak
Lysak / httrack.sh
Created April 16, 2026 18:02
httrack.sh
httrack "https://example-2026.localhost/" \
-O "example-2026.localhost" \
-%v \
--robots=0 \
-%P \
-n \
-F "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
@Lysak
Lysak / 4read.org.sh
Last active April 6, 2026 05:46
Download files from 4read.org website
mkdir -p ~/audiobooks
cd ~/audiobooks
for i in $(seq -w 1 17); do
curl -fL "https://s1.reasd.org/7292/OUZA_${i}_rendered.mp3" \
-o "Отель 'У загиблого альпініста' ${i}.mp3"
done
@Lysak
Lysak / smoke-script.js
Last active March 30, 2026 07:26
smoke-script.js
/* smoke-script.js
* – plynulý kouř, fade-in/fade-out
* – pozastaví se, když HERO2 není v záběru (IntersectionObserver)
* – probuzení záložky/telefonu už neodskakuje
*/
(function () {
const smokeURL = './images/Smoke-Element-white.png';
/* ---------- laditelné parametry ---------- */
const smokeSpeed = 1.4;
@Lysak
Lysak / backup-postgres-docker.txt
Created March 16, 2026 21:54
backup-postgres-docker.txt
Готове автоматизоване рішення для бекапу баз postgres.
Зараз часто використовую цей невеличкий контенер там де апки використовують базу на PosgreSQL.
Для додавання у docker-compose.yml
  postgres-backup:
    image: prodrigestivill/postgres-backup-local
    container_name: pg-backup
    restart: always
    environment:
      POSTGRES_HOST: ${POSTGRES_HOST}
@Lysak
Lysak / Task.php
Created February 19, 2026 16:13
php test task
<?php
//
// //count(array_filter($this->getUsers(), fn($user) => $user['city_id'] === $cityId));
class Test
{
/**
* Example:
* [
@Lysak
Lysak / queries.sql
Created February 19, 2026 16:05
sql test task
-- https://onecompiler.com/mysql/44e3ra35j
-- create
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name varchar(255) NOT NULL,
email varchar(255) NOT NULL,
city_id INTEGER NOT NULL
);
@Lysak
Lysak / com.user.LangSwitcher.plist.md
Last active February 5, 2026 20:36
Keep Lang Switcher always running on macOS (launchd + AppleScript)

Keep Lang Switcher always running on macOS (launchd + AppleScript)

This setup ensures Lang Switcher is always running on macOS.
If the app crashes or is accidentally closed, it will automatically restart.
Unlike open -a, this method avoids stealing focus every time Lang Switcher launches.


⚙️ Installation

@Lysak
Lysak / react-live-coding.ts
Created February 2, 2026 18:41
react-live-coding.ts
import { useState, useEffect } from "react";
const useUserData = (userId) => {
const [user, setUser] = useState(null);
useEffect(() => {
const fetchUser = async () => {
const response = await fetch(`https://api.example.com/users/${userId}`);
const data = await response.json();
setUser(data);