Skip to content

Instantly share code, notes, and snippets.

View Xrayez's full-sized avatar
🔱
Ukraine is winning

Andrii Doroshenko Xrayez

🔱
Ukraine is winning
View GitHub Profile
@Xrayez
Xrayez / gcd_lcm.lua
Last active April 16, 2023 12:53
Greatest Common Divisor (GCD) and Least Common Multiple (LCM) implemented in Lua
-- Greatest Common Divisor (Euclidean algorithm).
function math.gcd(a, b)
local t
while b ~= 0 do
t = b
b = math.fmod(a, b)
a = t
end
return a
end
@Xrayez
Xrayez / AI.md
Last active August 8, 2023 17:42
Problem-solving and research-oriented ChatGPT/AI prompts

Prompts

Added Complexity Justification

There exists a method known to solve a problem. However, it is not clear why the method is necessary to apply or whether using it justifies the added complexity. For learning purposes, provide a practical example that demonstrates a problem in detail without using the said method. After that, provide an example that incorporates the method, allowing the problem to be solved. Describe the reasons why it is beneficial to do so and suggest simpler alternative solutions, if necessary. Format the response in Markdown. The question is:

Given a statement, apply the "Five whys" technique. For each of the five questions, provide a detailed answer, nothing more. Format the entire response in Markdown, alternating questions and answers. The statement is:

@Xrayez
Xrayez / fix_bluetooth_disconnect.md
Last active May 2, 2026 01:24
Fix Bluetooth gamepad trapped in connected/disconnected cycle

Ubuntu-based:

If you can't connect the gamepad at all, try changing/adding this to /etc/bluetooth/input.conf:

ClassicBondedOnly=false

then in /etc/bluetooth/main.conf, change/add:

FastConnectable = true
Privacy = device