Skip to content

Instantly share code, notes, and snippets.

View xorik's full-sized avatar
🙃
Building something great!

Andrey xorik

🙃
Building something great!
View GitHub Profile
@xorik
xorik / gist:7dfbca49061d77b0d67c3d5fec82caad
Created November 23, 2026 08:40
Full list of optimizations for KSP so far
Options in the window (on by default):
- Free unused part models: outside the VAB/SPH, models of parts not on any craft leave memory and come back in the VAB/SPH: 0.5-0.9 GB less.
- Static part icons: the VAB/SPH part list uses ready-made pictures, so opening the VAB does not load every part model: ~330 MB less.
- Free ground scatter textures in orbit (Parallax): released above 12 km, reloaded below 10 km: 0.26-0.65 GB less.
- Low-res textures for distant planets: far planets and moons use small copies, the full texture loads when it would be visible: 0.16-0.65 GB less.
- Low-res planet textures in map view: the planet you are at also uses the small copy while you are far from it; the full one loads as you approach.
Always on, loading:
- Textures that are never shown are not loaded: Kcalbeloh skybox, duplicate sun-flare textures.
- Kcalbeloh EVE textures are not loaded when EVE is not installed: ~230 MB less video memory.
@xorik
xorik / restore-empty-lines.php
Created December 30, 2021 21:38
Restore empty lines after rector
<?php
declare(strict_types=1);
exec('git diff', $diff);
$currentFile = $chunkStart = null;
$fileChanged = false;
$chunkOffset = 0;
$fileLines = [];
@xorik
xorik / portamento.rb
Last active January 26, 2021 09:35
Sonic pi portamento
STOP_NOTE = 60 # stop on pressing the C note, you can use another MIDI or timer event to stop the synth
live_loop :midi_keys do
use_real_time
note, velocity = sync "/midi:*:1/note_*"
if velocity > 0 && note != STOP_NOTE
if (get :current_note) == nil
use_synth :dsaw
x = play note: note, note_slide: 0.3, amp: velocity / 127.0, sustain: 300
<?php
use Brick\Math\BigInteger;
require __DIR__.'/vendor/autoload.php';
global $digits;
$digits = [2, 3, 4, 6, 7, 8, 9];
$maxLen = 0;
@xorik
xorik / MF.md
Last active June 5, 2026 10:48
Польские инкубаторы

Moja Firma

https://mojafirma.org/

Шаги

  1. Вы заключаете контракт со своим клиентом (клиентами) или через фриланс биржи, используя юридические данные нашего бизнес-инкубатора;
  2. Полученные средства поступают на ваш фирменный суб-счет (валюта PLN, EUR, USD), которые вы потом себе выплачиваете как заработную плату в рамках договора с нами;
  3. Предоставив польским государственным органом подтверждение того, что вы тведете деятельность и проводите доход легально, вы получаете ВНЖ в Польше.
@xorik
xorik / README.md
Last active August 14, 2020 08:54
Toggl api PHP
  • composer install ajt/guzzle-toggl
  • Put your token into line 8
  • Run getProjects(), put workspace and project ID in lines 9 and 10
  • Run getTasks() or getCurrentTask()
@xorik
xorik / Email.php
Created February 19, 2017 08:34
phpspec demo
<?php
namespace App;
class Email
{
protected $body;
public function setBody($body)
{
$this->body = $body;