Skip to content

Instantly share code, notes, and snippets.

View Bryukh's full-sized avatar
🌍
Working from earth

Valentin Briukhanov Bryukh

🌍
Working from earth
View GitHub Profile
@Bryukh
Bryukh / system.lua
Created October 19, 2023 14:47
handle touch
local ServerScriptService = game:GetService("ServerScriptService")
local ECS = ServerScriptService.ECS
local Types = require(ECS.Types)
local System = require(ECS.System)
local Components = ECS.Components
local TouchToEnable = require(Components.TouchToEnable)
local Position = require(Components.Position)
local Enabled = require(Components.Enabled)
/*
Steps for using:
1. Go to the level editor for the level.
2. Double click the Hero Placeholder to edit it.
3. Run the level so you have the child window open.
4. Make sure the equipment you have equipped matches the hero's equipment for for the course.
5. Copy paste the solution code from the level editor into level, press run/submit. (Just want all the frames to load and ensure it succeeds)
6. Put this script into the console of the level-editor tab/window
Now everything (seed, equipment, frames, hash) should be added to the solutions.
*/
@Bryukh
Bryukh / .dockerignore
Last active October 11, 2018 10:55
Codecombar Dev Env Docker
*node_modules*
.git
.cache
.vagrant
app/
headless_client
public/
scripts/
temp/
test/
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после
# каждого слова из шести букв должен стоять значок «™». Примерно так:
#
# http://habrahabr.ru/company/yandex/blog/258673/
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из
# них, а именно — о настройке ciphersiutes.
#
#A is FromPoint B is ToPoint, [x, y] is a hit point
if min(x, xa) <= xb <= max(x, xa) and min(y, ya) <= yb <= max(y, ya):
return True
elif min(xa, xb) <= x <= max(xb, xa) and min(yb, ya) <= y <= max(yb, ya):
return True
else:
return False
from svg import SvgManipulationField
from svg import rotate, scale, resize, png
def scale(xml, scale_factor):
scale_width, scale_height = scale_factor
return scaled_xml
class TestModel(models.Model):
logo = SvgManipulationField(