Skip to content

Instantly share code, notes, and snippets.

View kezzyhko's full-sized avatar
💜
💜💜💜🤍🤍 3/5

Sergey Semushin kezzyhko

💜
💜💜💜🤍🤍 3/5
View GitHub Profile
@kezzyhko
kezzyhko / ReflectionExtensions.cs
Last active August 22, 2024 16:33
Class for testing reflection extensions
// https://www.programiz.com/csharp-programming/online-compiler/
// Online C# Editor for free
// Write, Edit and Run your C# code using C# Online Compiler
using System;
using System.Collections.Generic;
using System.Reflection;
using Pure = System.Diagnostics.Contracts.PureAttribute;
public class Test {
@kezzyhko
kezzyhko / RandomTest.cs
Created August 15, 2024 07:29
Quick and dirty code to test random distributions
using System;
using System.Collections.Generic;
public class HelloWorld
{
public static void Main(string[] args)
{
var random = new Random();
var distribution = new Dictionary<int, int>();
var SCALE = 1000;
@kezzyhko
kezzyhko / ForEachExtensions.cs
Created August 1, 2024 18:07
C# - static class with collection of extension-methods for easier array enumerating/updating
using System;
using System.Collections.Generic;
public static class ForEachExtensions
{
public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
{
foreach(var item in enumeration)
{
@kezzyhko
kezzyhko / NormalizeModel.lua
Created April 18, 2024 17:24
Script for Roblox to weld uploaded model and add a root part
local model = game.Selection:Get()[1]
local root = Instance.new("Part")
root.Name = "RootPart"
root.Size = Vector3.one
root.EnableFluidForces = false
root.CanCollide = false
root.CanQuery = false
root.CanTouch = false
root.Transparency = 1
<?php
function shell_with_print($cmd_pattern, ...$argv) {
$cmd = sprintf("$cmd_pattern 2>&1", ...$argv);
echo $cmd;
echo "\n";
system($cmd, $ret);
return ($ret == 0);
}
@kezzyhko
kezzyhko / !RobloxVideoPlayer.md
Last active February 8, 2024 20:26
Video player for Roblox on EditableImage

This is a video player for Roblox on EditableImage

How to use

On http server

  • Change SERVER_ADDRESS in VideoPlayer.py to whatever you want
  • Install dependencies for VideoPlayer.py script: numpy and opencv
  • Run VideoPlayer.py on your server
  • Setup VideoId.txt files, which link to video file and contain asset id of audio uploaded to roblox

Inside Roblox

  • Put VideoDownloader.lua into ServerScriptService as server Script
  • Inside VideoDownloader, create module Config which has UrlBase set to you server address in format https://example.com/
@kezzyhko
kezzyhko / MoveToCamera.lua
Created January 13, 2024 16:12
Moves selected part/model to current camera position
game.Selection:Get()[1]:PivotTo(workspace.CurrentCamera.CFrame)
@kezzyhko
kezzyhko / SelectDescendantsOfType.lua
Last active October 27, 2023 17:29
This script selects descendants of selected instance, but only of specific type
local p = game.Selection:Get()[1]
for _, obj in pairs(p:GetDescendants()) do
if obj:IsA("Seat") then
game.Selection:Add({obj})
end
end
game.Selection:Remove({p})
@kezzyhko
kezzyhko / getRegistraionDates.lua
Last active September 4, 2023 10:32
Prints Roblox registration dates of all players on server
local players = game:GetService("Players"):GetPlayers()
for _, player in pairs(players) do
local registrationTimestamp = (os.time() - player.AccountAge * 86400)
local registrationDateString = os.date("%Y-%m-%d", registrationTimestamp)
print(player.Name, registrationDateString)
end