Skip to content

Instantly share code, notes, and snippets.

View Hammer2900's full-sized avatar
🚚
Working from home

Yevhen Ts. Hammer2900

🚚
Working from home
View GitHub Profile
import Box2D
import Box2D.b2 as b2
class b2Separator:
"""
* Convex Separator for Box2D Flash
*
* This code has been ported to Python by Stephen Tian from the Java port by Chad Palsulich of the Flash original written by Antoan Angelov.
from threading import Thread
from pyray import *
from raylib import *
from time import sleep
# control variables
downloadPressed = False
uploadPressed = False
@Hammer2900
Hammer2900 / fast_game_install.py
Created August 6, 2023 20:18
Bottle fast game install
import uuid
from pathlib import Path
import sh
import fire
import yaml
DEFAULT_GAME_PATH = '/home/izot/Downloads/torrents/The-Last-Starship-Alpha-5a_setup.exe'
DEFAULT_BOTTLE_LIB_PATH = '/home/izot/Downloads/_bottle_area'
from flask import Flask
import webview
import sys
import threading
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@Hammer2900
Hammer2900 / odoo.sh
Created May 15, 2023 20:42 — forked from jjackofall/odoo.sh
Install Odoo In Server
#!/bin/bash
# Variables
OE_USER="odoo"
OE_HOME="/$OE_USER"
OE_HOME_EXT="/$OE_USER/${OE_USER}-server"
INSTALL_WKHTMLTOPDF="True"
OE_PORT="8069"
OE_VERSION="15.0"
OE_SUPERADMIN="admin"
class StateMachine:
states = ["NO STATE"]
user_states = {}
def __init__(self,states):
if states:
self.states.extend(states)
else:
raise ValueError("StateMachine must have at least one state")
def next(self,user_id):
@Hammer2900
Hammer2900 / gist:a4795ddb6ae627fda50bcb12c396ba32
Created February 24, 2023 13:22 — forked from eamirgh/gist:650f86393b1826dd5c5e5fc68dd5f06e
RESET Goland Evaluation period LINUX
rm -rf ~/.config/JetBrains/GoLand2021.3/eval
rm -rf ~/.config/JetBrains/GoLand2021.3/options/other.xml
touch ~/.config/JetBrains/GoLand2021.3/options/other.xml
sed -i -E 's/<property name=\"evl.*\".*\/>//' ~/.config/JetBrains/GoLand2021.3/options/other.xml
rm -rf ~/.java/.userPrefs/jetbrains/goland
@Hammer2900
Hammer2900 / config.fish
Created December 22, 2022 09:17
This will define an alias called find-and-activate that will search for directories within the current directory (.), and then check if each directory contains a file called activate.fish. If the file is found, the . command will be used to execute the file in the current shell. The return command will exit the alias once the first activate.fish…
# Define the function
function find-and-activate
for dir in (find . -type d)
if test -f $dir/activate.fish
. $dir/activate.fish
return
end
end
end
@Hammer2900
Hammer2900 / ecs_types.py
Created December 3, 2022 08:47 — forked from RustyGuard/ecs_types.py
Полный пример реализации и использования Entity Component System на python
from dataclasses import dataclass
from typing import Any, Type
EntityId = str
Component = object
@dataclass
class StoredSystem:
variables: dict[str, Any]
@Hammer2900
Hammer2900 / bluetooth.sh
Created December 2, 2022 09:44 — forked from miguelmota/bluetooth.sh
Arch linux bluetooth connect example
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on
[bluetooth]# pair 7C:9A:1D:B3:57:BA
[bluetooth]# connect 7C:9A:1D:B3:57:BA