Skip to content

Instantly share code, notes, and snippets.

View michelv's full-sized avatar

michel v michelv

View GitHub Profile
@michelv
michelv / igdump
Last active December 8, 2018 21:31
igdump : a command line utility to unserialize and dump igbinary-serialized PHP data
#!/usr/bin/env php
<?php
if (isset($argv[1]) && ($argv[1] == '--help' || $argv[1] == '-h')) {
echo sprintf(
"Usage: \n [igbinary-serialized data] | %s\n",
basename(__FILE__)
);
exit();
}
from kb import KMKKeyboard
from kmk.keys import KC
from kmk.modules.layers import Layers
from kmk.modules.modtap import ModTap
from kmk.hid import HIDModes
from kmk.handlers.sequences import send_string
import supervisor
from kmk.extensions.peg_oled_Display import Oled,OledDisplayMode,OledReactionType,OledData
from kmk.extensions.peg_rgb_matrix import Rgb_matrix
from kmk.modules.split import Split, SplitSide, SplitType
@michelv
michelv / testcase.php
Created September 29, 2022 21:01
one way to simulate a DBAL DriverException in your PHPunit tests
<?php
declare(strict_types=1);
use Doctrine\DBAL\Driver\Exception as TheDriverException;
use Doctrine\DBAL\Exception\DriverException;
use PHPUnit\Framework\TestCase;
final class MyTest extends TestCase
{
@michelv
michelv / ConsecutiveCallsTrait.php
Last active March 2, 2023 15:07
Replacement for PHPUnit's deprecated method InvocationMocker::withConsecutive
<?php
declare(strict_types=1);
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
/**
* This is a replacement for InvocationMocker::withConsecutive() which is
@michelv
michelv / install-cq-editor.sh
Last active September 30, 2023 16:58
install Cadquery and CQ-editor on ARM macOS (Mac M1, M2)
# type this in your Terminal/iTerm/whatever:
# get conda
brew install miniforge
conda init "$(basename "${SHELL}")" # as indicated by homebrew