Skip to content

Instantly share code, notes, and snippets.

View patoui's full-sized avatar
😃
Trying to write code my future self will be proud of

Patrique Ouimet patoui

😃
Trying to write code my future self will be proud of
View GitHub Profile
<?php
declare(strict_types=1);
/**
* src/
* Domain/
* Entity/
* Factory/
* Repository/ // repository interfaces
@patoui
patoui / temp_secrets.php
Last active July 21, 2022 13:27
Temporary/short lived secrets script
<?php
declare(strict_types=1);
/**
* Tested with PHP 8.1
* Create a sqlite file named `secrets.db` in the same directory
* Required extensions: sqlite3/pdo_sqlite, openssl
* Recommended extension: uuid
*
##### dataCount: 10000, seletCount: 1, limit: 5000 #####
PhpClickhouse 0.076
SeasClickNonCompression 0.062
SeasClickCompression 0.064
OneCk 0.095
--------------------------------
Total 0.297
##### dataCount: 10000, seletCount: 1, limit: 5000 #####
PhpClickhouse 0.051
@patoui
patoui / prototype_pollution_example.js
Last active July 13, 2023 15:45
Prototype pollution example
// see https://learn.snyk.io/lesson/prototype-pollution/ for additional information and great explanations
// recursively update target with source data
function merge(target, source) {
for (const attr in source) {
if (
typeof target[attr] === "object" &&
typeof source[attr] === "object"
) {
merge(target[attr], source[attr])
@patoui
patoui / nativephp-linux-patch.sh
Created July 21, 2023 13:32
Script to fix issues when running NativePHP on Linux
#!/bin/bash
# when running `php artisan native:install`, when prompted to start the development server select "no"
# copy this file within the root of your project/application and run it `bash nativephp-linux-patch.sh`
# after running this script run `php artisan native:serve`
sed -i 's/app.dock.setIcon(state_1.default.icon);/\/\/app.dock.setIcon(state_1.default.icon);/g' vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js
cp -L /usr/bin/php vendor/nativephp/php-bin/bin/mac/x86/php