Skip to content

Instantly share code, notes, and snippets.

View RSalo's full-sized avatar
🏠
Working from home

Roman Salnikov RSalo

🏠
Working from home
  • Flustr
  • Molodechno
View GitHub Profile
@RSalo
RSalo / BatteryModel.cs
Created September 7, 2025 12:43
Propulsion mod by ChatGPT
using UnityEngine;
namespace UBOAT.Mods.HistoricalPropulsion
{
public static class BatteryModel
{
// Получить энергию батареи в kWh
public static float GetBatteryEnergy_kWh(string typeId)
{
var spec = BoatSpecsLoader.GetSpec(typeId);
@RSalo
RSalo / gist:af68a606a2d2840860775e28b4e6d4ba
Created October 25, 2020 15:38
symfony-cmf/resource-rest-bundle unit Exception
roman@roman-salnikov-pc:~/Public/projects/resource-rest-bundle$ make unit_tests
+++ run unit tests +++
PHP Fatal error: Uncaught TypeError: Argument 1 passed to PHPUnit\Runner\BaseTestRunner::getTest() must be of the type string, object given, called in /home/roman/Public/projects/resource-rest-bundle/vendor/bin/.phpunit/phpunit-8.3-0/src/TextUI/Command.php on line 177 and defined in /home/roman/Public/projects/resource-rest-bundle/vendor/bin/.phpunit/phpunit-8.3-0/src/Runner/BaseTestRunner.php:84
Stack trace:
#0 /home/roman/Public/projects/resource-rest-bundle/vendor/bin/.phpunit/phpunit-8.3-0/src/TextUI/Command.php(177): PHPUnit\Runner\BaseTestRunner->getTest()
#1 /home/roman/Public/projects/resource-rest-bundle/vendor/bin/.phpunit/phpunit-8.3-0/src/TextUI/Command.php(160): PHPUnit\TextUI\Command->run()
#2 /home/roman/Public/projects/resource-rest-bundle/vendor/bin/.phpunit/phpunit-8.3-0/phpunit(22): PHPUnit\TextUI\Command::main()
#3 /home/roman/Public/projects/resource-rest-bundle/vendor/symfony/phpunit-
@RSalo
RSalo / gist:34307a2a68fabdb27ad516885cee4a04
Last active May 21, 2020 12:44
lando docker permission
sudo chmod 666 /var/run/docker.sock
@RSalo
RSalo / ReturnVsYield.php
Last active October 7, 2019 15:24
RETURN vs YIELD Performance
function getValues() {
$valuesArray = [];
// get the initial memory usage
echo round(memory_get_usage() / 1024 / 1024, 2) . ' MB' . PHP_EOL;
for ($i = 1; $i < 800000; $i++) {
$valuesArray[] = $i;
// let us do profiling, so we measure the memory usage
if (($i % 200000) == 0) {
// get memory usage in megabytes
echo round(memory_get_usage() / 1024 / 1024, 2) . ' MB'. PHP_EOL;