Skip to content

Instantly share code, notes, and snippets.

View Hammer2900's full-sized avatar
🌲
___

Yevhen Ts. Hammer2900

🌲
___
View GitHub Profile
@Hammer2900
Hammer2900 / main.odin
Last active January 18, 2026 10:11
torent client gui on odin, place to example folder
package main
import syl "../.."
import renderer "../../renderer/raylib"
import rl "vendor:raylib"
import "core:fmt"
// --- Colors (uTorrent Palette) ---
UT_BG :: [4]u8{ 240, 240, 240, 255 }
UT_WHITE :: [4]u8{ 255, 255, 255, 255 }
@Hammer2900
Hammer2900 / snake_neat.odin
Created January 4, 2026 18:38
neat snake test map
package main
import "core:encoding/json"
import "core:fmt"
import "core:math"
import "core:math/rand"
import "core:os"
import "core:slice"
import "core:strings"
import "vendor:raylib"
@Hammer2900
Hammer2900 / 1.sh
Created December 31, 2025 22:53
Odin ECS Particle Life Evolution
odin build . -o:speed
@Hammer2900
Hammer2900 / wifi.odin
Created December 31, 2025 22:18
wifi linux scaner
package wifi_viz
import "core:fmt"
import "core:strings"
import "core:strconv"
import "core:math"
import "core:math/rand"
import "core:c"
import "core:thread"
import "core:sync"
@Hammer2900
Hammer2900 / tetris_ecs.odin
Created December 31, 2025 21:17
tetris ecs odin
package game
import "core:fmt"
import "core:math"
import "core:math/rand"
import rl "vendor:raylib"
// --- КОНСТАНТЫ ---
CELL_SIZE :: 30
COLS :: 10
@Hammer2900
Hammer2900 / rc.lua
Created December 26, 2025 14:53
Smart Hot Corners (Global Back / Alt-Tab Teleport)
-- ===================================================================
-- LEFT HOT CORNER (Smart Client Menu)
-- ===================================================================
-- 1. Variable to track the menu instance (to check visibility later)
local client_menu_instance = nil
-- 2. Timer to prevent "debouncing" (accidental multiple triggers)
local hot_corner_timer = gears.timer {
timeout = 0.5,
@Hammer2900
Hammer2900 / .xonshrc
Created December 13, 2025 12:00
save xonsh history to index
import sys
import os
# Добавляем путь к папке с расширениями (если еще нет)
ext_dir = os.path.expanduser('~/.xonsh')
if ext_dir not in sys.path:
sys.path.append(ext_dir)
# Импортируем наш класс
from history_search import SearchEngineHistory
@Hammer2900
Hammer2900 / __init__.py
Created October 19, 2025 21:03
esper numpy
"""
Esper-Numpy - высокопроизводительная Entity Component System (ECS) для Python на базе NumPy.
ИСПРАВЛЕНА проблема с копированием данных при индексации.
"""
import time as _time
import numpy as np
import inspect as _inspect
from dataclasses import is_dataclass, fields as _dataclass_fields
from types import MethodType as _MethodType
@Hammer2900
Hammer2900 / __init__.py
Last active October 19, 2025 12:19
python esper speed test
"""Optimized esper - faster Entity System (ECS) for Python
Key optimizations:
1. Lazy cache invalidation
2. Faster component lookups with cached min sets
3. Direct entity component dict access
4. Optimized dead entity cleanup
5. Fast processor lookup dict
"""
import time as _time
@Hammer2900
Hammer2900 / main.py
Created October 18, 2025 08:02
umpacking test speed
import timeit
from dataclasses import dataclass, replace
# ============================================================
# Исходные данные
# ============================================================
color = (0, 121, 241, 255)
new_alpha = 128
EXPECTED = (0, 121, 241, 128)