Skip to content

Instantly share code, notes, and snippets.

View ilnytskyi's full-sized avatar

Stanislav Ilnytskyi ilnytskyi

View GitHub Profile
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@jfeilbach
jfeilbach / grub.md
Last active July 1, 2025 15:09
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

@kirmorozov
kirmorozov / Magento_2.2.2_PHP7.4_Preload_vs_PHP-7.3-results.md
Last active August 23, 2021 13:25
Magento PHP7.4 Preload vs PHP 7.3 results.md

Current Magento 2.2.2 PHP 7.4 with preload is 10%+ faster

Comparison of means

PHP 7.4 with preload is 11.07% faster then PHP 7.3

PHP 7.4 with preload is 13.25% faster then PHP 7.1

Sample 1 PHP 7.4 with Preload

Mean: 0.458

@Ryanb58
Ryanb58 / profile.md
Last active January 25, 2024 14:23
How to profile a Node.JS application and Visualize/debug the results.

Profile your node app:

node --prof-process app.js

Visualize the data by opening chrome and going too:

chrome://tracing

@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active September 12, 2025 19:54
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for(...;...;...) or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@ProcessEight
ProcessEight / Testing in Magento 2.md
Last active October 3, 2025 15:16
M2: Notes on setting up PHPUnit and writing/troubleshooting tests in Magento 2
<?php
class AnswerAdder
{
private function addTheAnswer($x)
{
return 42 + $x;
}
}
@epicserve
epicserve / redis_key_sizes.sh
Last active February 21, 2025 22:37
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}