Skip to content

Instantly share code, notes, and snippets.

View Lysak's full-sized avatar
🎯

Dmytrii Lysak

🎯
View GitHub Profile
@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);
@Lysak
Lysak / fizzbuzz.js
Created January 26, 2026 15:22
fizzbuzz.js
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 / example.json
Last active December 21, 2025 20:27
example.json
{
"schemaVersion": 1,
"label": "Codewars",
"labelColor": "#B1361E",
"message": "honor",
"color": "#B1361E",
"namedLogo": "codewars",
"logoColor": "white",
"style": "for-the-badge"
}
@Lysak
Lysak / com.user.googlechat.plist.md
Last active August 26, 2025 15:26
Keep Google Chat always running on macOS (launchd + AppleScript)

Keep Google Chat always running on macOS (launchd + AppleScript)

This setup ensures Google Chat 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 Google Chat launches.


⚙️ Installation

@Lysak
Lysak / biome.jsonc
Last active August 17, 2025 10:45
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 / bulk‐rewriting commit authors.txt
Created May 4, 2025 13:32
bulk‐rewriting commit authors
install `pip install git-filter-repo`
### 1) Create a mailmap file
In your repo root, create e.g. `rewrite-mailmap.txt` with **Git’s mailmap syntax**, e.g.:
```
# Format: Proper Name <proper@email> <old@email>
Your New Name <new.email@example.com> <old.email@example.com>
```
@Lysak
Lysak / cursor-local.rules
Last active November 1, 2025 20:14
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 / pre-commit
Created April 21, 2025 10:31
~/.git-hooks/pre-commit
#!/usr/bin/env bash
# Fetch Git configuration values
REMOTE_URL=$(git config --get remote.origin.url)
USER_EMAIL=$(git config user.email)
echo "🔍 Git Hook Running..."
echo "➡ Remote URL: $REMOTE_URL"
echo "➡ User email: $USER_EMAIL"
@Lysak
Lysak / crontab.txt
Last active April 14, 2025 13:41
laravel queue crontab with logging example
* * * * * cd /var/www/html2/laravel && sleep 5 && ./vendor/bin/sail php artisan queue:work --sleep=3 --tries=2 --max-time=3600 --stop-when-empty >> /var/www/html/laravel/storage/logs/crontab.log 2>&1