Skip to content

Instantly share code, notes, and snippets.

View Lysak's full-sized avatar
🎯

Dmytrii Lysak

🎯
View GitHub Profile
@Lysak
Lysak / fizzbuzz.js
Last active April 18, 2026 10:29
fizzbuzz.js and fizzbuzz.php implementations
for (let i = 1; i <= 30; i++) {
const fizz = !(i % 3);
const buzz = !(i % 5);
if (fizz && buzz) console.log("FizzBuzz");
else if (fizz) console.log("Fizz");
else if (buzz) console.log("Buzz");
else console.log(i);
}
@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 / biome.jsonc
Last active February 23, 2026 22:28
biome.jsonc file for the NestJS framework (2025), using Biome v2.2.0 and NestJS v11.1.6. Generated from ESLint and Prettier based on a basic NestJS configuration.
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false },
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
@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 / cursor-local.rules
Last active February 11, 2026 10:54
cursor-local.rules
- Answer in English
- Do not give high-level responses; your task is to provide concrete, project-applicable solutions
- Do not give detailed explanations, but describe the purpose of each change
- Before making changes, outline an implementation plan in bullet points, then proceed to implementation
- Follow linters when writing code
#github.com/QuantGeekDev/docker-mcp
@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