Skip to content

Instantly share code, notes, and snippets.

View debuss's full-sized avatar
🐝
Beezy.

Debusschère Alexandre debuss

🐝
Beezy.
View GitHub Profile
@debuss
debuss / hf-validator.py
Last active September 8, 2022 14:13
Pega Hotfix Validator script in Python3
# Pega Hotfix Validator script.
# @author Alexandre Debusschère <alexandre.debusschere@hey.com>
# @see https://docs.pega.com/keeping-current-pega/86/manually-verifying-hotfix-files-using-third-party-tools
from sys import exit, argv
from os import path, chdir
from zipfile import ZipFile
from operator import itemgetter
from shutil import rmtree
import json
@debuss
debuss / hf-validator.php
Last active June 23, 2022 08:12
Pega Hotfix Validator script in PHP
<?php
/**
* Pega Hotfix Validator script.
*
* With this little script you can manually validate a hotfix download from Pega MPS.
* It simply process the different steps described in the Pega documentation, see below.
*
* @author Alexandre Debusschère <alexandre.debusschere@hey.com>
* @see https://docs.pega.com/keeping-current-pega/86/manually-verifying-hotfix-files-using-third-party-tools
*/
/**
* CustomSessionStorage implementation with FaunaDb for your Node API Shopify app.
*
* On Fauna Dashboard, in my database, I created a Collection "Sessions" (with a TTL of 2 days, but configure it as you wish).
* I also added an Index "session_by_id" with Terms set as "data.id" and Serialized.
*
* In the constructor, replace my settings with yours to make the connection.
* If you have a different Collection and/or Index, then also update each method to use the correct configuration.
*
* @author Alexandre DEBUSSCHÈRE <alexandre@kosmonaft.dev>
@debuss
debuss / prestashop_create_references.sql
Created April 25, 2018 02:26
This query generate references (SKU) for your products and combinations on PrestaShop.
-- Set references on parent products
UPDATE `ps_product` p
SET p.`reference` = REPLACE(REPLACE(LOWER(CONCAT_WS(
"_",
LEFT((SELECT CONVERT(`name` USING ascii) FROM `ps_product_lang` pl WHERE pl.`id_product` = p.`id_product` LIMIT 1), 10),
p.`id_product`,
"0"
)), "?", ""), " ", "")
WHERE p.`reference` IS NULL
OR p.`reference` = "";
@debuss
debuss / my_base64_functions.php
Created May 24, 2017 08:25
An implementation of base64 functions for PHP.
<?php
function my_base64_encode($str)
{
$base64 = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');
$bit_pattern = '';
$padding = 0;
$encoded = '';
foreach (str_split($str) as $char) {
@debuss
debuss / arrayColumn.php
Last active February 2, 2021 01:29
Implementation of array_column function for PHP 5.3+, support for array of objects is also provided.
<?php
/**
* Implementation of array_column function for PHP 5.3+, support for array of objects is also provided.
*
* @param array $input
* @param mixed $column_key
* @param mixed $index_key
* @return array
* @see http://php.net/manual/en/function.array-column.php