Skip to content

Instantly share code, notes, and snippets.

View kpodemski's full-sized avatar
🏠
Working from home

Krystian Podemski kpodemski

🏠
Working from home
View GitHub Profile
@kpodemski
kpodemski / extrafieldinwhitelist.php
Created August 28, 2020 11:25
PrestaShop - add your own variable to whitelist
<?php
class ExtraFieldInWhitelist extends Module
{
public function __construct()
{
$this->name = 'extrafieldinwhitelist';
$this->tab = 'front_office_features';
$this->version = '1';
$this->author = 'Krystian Podemski';
@kpodemski
kpodemski / combos.php
Created February 4, 2021 11:56 — forked from farinspace/combos.php
Recursive functions, I can never find exactly what I need in a pinch
<?php
function combos($data, &$all = array(), $group = array(), $val = null, $i = 0) {
if (isset($val)) {
array_push($group, $val);
}
if ($i >= count($data)) {
array_push($all, $group);
} else {
foreach ($data[$i] as $v) {
#!/bin/bash
FILES_TO_COMMIT=`git status -s | cut -c4-`
if [[ ! -z $FILES_TO_COMMIT ]]; then
for file in $FILES_TO_COMMIT; do
if [[ "$file" == *.php ]]; then
./vendor/bin/php-cs-fixer fix "$file"
fi
done