Skip to content

Instantly share code, notes, and snippets.

View paranoiq's full-sized avatar
🍵
418 I am a teepot

Vlasta Neubauer paranoiq

🍵
418 I am a teepot
View GitHub Profile
@paranoiq
paranoiq / tools.md
Last active April 17, 2026 12:20
Dev tools

Simple dev tools and QOL improvements:

@paranoiq
paranoiq / scripts.php
Created April 5, 2026 12:54
Simple Composer plugin to lists only user-defined scripts and their shortcuts
<?php
/**
* Composer plugin to lists user-defined scripts from composer.json in the same format as `composer list`.
*/
$composerJson = dirname(__DIR__) . '/composer.json';
$data = json_decode(file_get_contents($composerJson), true, 100, JSON_THROW_ON_ERROR);
$scripts = array_keys($data['scripts'] ?? []);
@paranoiq
paranoiq / phpstan-tweak.php
Last active April 5, 2026 12:41
PHPStan output tweaker - version, colors, better dividers
<?php
// Ensure output is treated as a TTY/ANSI capable stream
// Usage: phpstan analyze --ansi | php phpstan-tweak.php
$width = static function (): int
{
static $col;
if ($col !== null) {
return $col;
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@paranoiq
paranoiq / index.php
Created November 29, 2022 12:25
Generator of the Supersymmetric Table of Cellular Automata
<?php
error_reporting(E_ALL);
function bin(int $n): string
{
$bin = str_pad(decbin($n), 8, '0', STR_PAD_LEFT);
return substr($bin, 0, 4) . ' ' . substr($bin, 4, 4);
}
<?php declare(strict_types = 1);
/**
* This file is part of the SqlFtw library (https://github.com/sqlftw)
*
* Copyright (c) 2017 Vlasta Neubauer (@paranoiq)
*
* For the full copyright and license information read the file 'license.md', distributed with this source code
*/
// phpcs:disable Squiz.Arrays.ArrayDeclaration.ValueNoNewline
@paranoiq
paranoiq / es.json
Last active October 5, 2022 15:40
ElasticSearch Query Language idea...
{
"fields": [
"id",
"startTime",
"priority",
"malePriority",
"lastFourDaysMaleViewsInCity1",
"commissionPerVisit",
"lastFourDaysViewsInCity1",
"lastFourDaysViews"
- rule for Rewriter extension for Chrome
- makes gist editation window on GitHub much bigger
"match": ["rows=\"17\""], "substitute": "rows=\"80\"", "url": ["https://gist.github.com"];
@paranoiq
paranoiq / Assert.php
Last active August 29, 2015 14:20
Tester\Assert with fixed order of parameters
<?php
namespace Dogma\Tester;
/**
* Tester\Assert with fixed order of parameters
*/
class Assert extends \Tester\Assert
{
@paranoiq
paranoiq / pecl_http-stub.php
Last active August 29, 2015 14:12
Generated stub file for PHP extension `http` v2.1.4
<?php
// extension: http
// version: 2.1.4
namespace {
define('http\Client\Curl\HTTP_VERSION_1_0', 1);
define('http\Client\Curl\HTTP_VERSION_1_1', 2);
define('http\Client\Curl\HTTP_VERSION_ANY', 0);